diff --git a/cv3/program.c b/cv3/program.c index abc99e5..3b7db13 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -10,11 +10,21 @@ int main() { int length = 0; double result = 0.0; - while (count < SIZE && scanf("%lf", &input) == 1) { - coefs[count] = input; - count++; + while (count < SIZE) { + if (scanf("%lf", &input) != 1) { + printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count + 1); + break; + } + + if (input == 'x') { + break; + } } + coefs[count] = input; + + count++; + x = coefs[0]; length = count;