diff --git a/cv3/program.c b/cv3/program.c index 91964df..4a9d49b 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -12,6 +12,8 @@ int main() { while (count < SIZE) { + coefs[count] = input; + if (scanf("%lf", &input) != 1 && (scanf("%c", &input) != 1 || input != 'x')) { printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count + 1); break; @@ -19,13 +21,8 @@ int main() { if (input == 'x') { break; } - coefs[count] = input; count++; - } - - coefs[count] = input; - - count++; + } x = coefs[0]; @@ -38,4 +35,4 @@ int main() { printf("Vysledok je: %.2lf\n", result); return 0; -} +} \ No newline at end of file