diff --git a/cv3/program.c b/cv3/program.c index 06db6db..3ef9ab9 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -18,19 +18,20 @@ int main() { if (scanf("%lf", &x) != 1) { printf("Nepodarilo sa nacitat zaklad x\n"); return 0; + } while (scanf("%lf", &coef) == 1) { coefficients[count++] = coef; } - + if (!feof(stdin)) { printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count + 1); - return 0; + return 0; } double result = evaluatePolynomial(x, coefficients, count); printf("Vysledok je: %.2f\n", result); - return 1; + return 0; }