Initialization

This commit is contained in:
Kozar 2024-03-04 19:57:08 +01:00
parent 4d2fb827b0
commit ab1ac589a8

View File

@ -11,11 +11,18 @@ int main() {
int length = 0; int length = 0;
double result = 0.0; double result = 0.0;
while (count < SIZE) { while (count < SIZE)
if (scanf("%d", &input) != 1) { {
printf("Nepodarilo sa nacitat polynom na %d mieste.", count); if (input == '\n')
break; {
continue;
}
if (scanf("%d", &input) != 1)
{
printf("Nepodarilo sa nacitat polynom na %d mieste.", count);
return 0;
} }
coefs[count] = input; coefs[count] = input;
count++; count++;
@ -25,7 +32,8 @@ int main() {
length = count; length = count;
for (int i = 1; i < length; i ++){ for (int i = 1; i < length; i ++)
{
result = result * x + coefs[i]; result = result * x + coefs[i];
} }