Обновить du2/program.c

This commit is contained in:
Denys Sanchuk 2025-02-25 14:06:18 +00:00
parent 0503c6bc30
commit 5b6d09c104

View File

@ -13,7 +13,12 @@ int main() {
return 1; return 1;
} }
while (count < MAX_SIZE && scanf("%lf", &coefficient) == 1) { while (count < MAX_SIZE) {
if (scanf("%lf", &coefficient) != 1) {
if (feof(stdin)) break; // Конец файла - завершаем чтение
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count + 1);
return 1;
}
coefficients[count++] = coefficient; coefficients[count++] = coefficient;
} }