lk
This commit is contained in:
parent
086d3eb16e
commit
ff92726086
BIN
du3/program
BIN
du3/program
Binary file not shown.
@ -1,21 +1,22 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
|
char riadok[999];
|
||||||
float vxod[999];
|
float vxod[999];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
float result = 0;
|
float result = 0;
|
||||||
while(1){
|
while(1){
|
||||||
float value = 0;
|
|
||||||
float r = scanf("%f", &value);
|
char* r = fgets(riadok,999,stdin);
|
||||||
if(r == 1)
|
if(*r != '\n')
|
||||||
vxod[i++] = value;
|
vxod[i++] = *r;
|
||||||
else if(r <= 255 && r >= 0){
|
/*else if(*r <= 255 && *r >= 0){
|
||||||
if(i != 0)
|
if(i != 0)
|
||||||
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i);
|
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i);
|
||||||
else
|
else
|
||||||
printf("Nepodarilo sa nacitat zaklad x\n");
|
printf("Nepodarilo sa nacitat zaklad x\n");
|
||||||
break;
|
break;
|
||||||
}else{
|
}*/else{
|
||||||
for(int a = 1; a < i; a++)
|
for(int a = 1; a < i; a++)
|
||||||
result = vxod[0] * result + vxod[a];
|
result = vxod[0] * result + vxod[a];
|
||||||
printf("Vysledok je: %.2f\n", result);
|
printf("Vysledok je: %.2f\n", result);
|
||||||
|
Loading…
Reference in New Issue
Block a user