diff --git a/du3/program b/du3/program index f0a512a..6578e88 100755 Binary files a/du3/program and b/du3/program differ diff --git a/du3/program.c b/du3/program.c index 6589e2c..af5957a 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,21 +1,22 @@ #include int main(){ + char riadok[999]; float vxod[999]; int i = 0; float result = 0; while(1){ - float value = 0; - float r = scanf("%f", &value); - if(r == 1) - vxod[i++] = value; - else if(r <= 255 && r >= 0){ + + char* r = fgets(riadok,999,stdin); + if(*r != '\n') + vxod[i++] = *r; + /*else if(*r <= 255 && *r >= 0){ if(i != 0) printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i); else printf("Nepodarilo sa nacitat zaklad x\n"); break; - }else{ + }*/else{ for(int a = 1; a < i; a++) result = vxod[0] * result + vxod[a]; printf("Vysledok je: %.2f\n", result);