diff --git a/cv3/program.c b/cv3/program.c index e46d9e4..b48d5b4 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -11,7 +11,12 @@ int main() { int length = 0; double result = 0.0; - while (count < SIZE && scanf("%lf", &input) == 1) { + while (count < SIZE) { + if (scanf("%d", &input) != 1) { + printf("Nepodarilo sa nacitat polynom na %d mieste.", count); + break; + + } coefs[count] = input; count++; } @@ -20,19 +25,6 @@ int main() { length = count; - // for (int y = 0; y < length; y++ ){ - // int b = coefs[y]; - - // if (isdigit(b) == 0){ - // printf("Nepodarilo sa nacitat polynom na %d mieste.", y); - // break; - // } - // else{ - // continue; - // } - - // } - for (int i = 1; i < length; i ++){ result = result * x + coefs[i]; }