Delete du2/program.c

This commit is contained in:
Martin Kačmár 2025-03-06 14:33:07 +00:00
parent 7f35afe633
commit a636264a9a

View File

@ -1,28 +0,0 @@
#include <stdio.h>
int main() {
double x, koeficient, vysledok;
int index = 1;
if (scanf("%lf", &x) != 1) {
printf("Chyba: Neplatná hodnota pre x.\n");
return 1;
}
if (scanf("%lf", &koeficient) != 1) {
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", index);
return 1;
}
vysledok = koeficient;
index++;
while (scanf("%lf", &koeficient) == 1) {
vysledok = vysledok * x + koeficient;
index++;
}
// Ak posledné čítanie nebolo úspešné a nie sme na konci vstupu, vypíšeme chybu
printf("Vysledok je: %.2f\n", vysledok);
return 0;
}