#include #include int main() { double x; double kof; double result = 0.0; int pocet_kof = 0; // Nacitanie x if (scanf("%lf", &x) != 1) { printf("Chyba: Neplatna hodnota x.\n"); return 1; } // Nacitanie koeficientu a vypocet while (scanf("%d", &kof) == 1) { result = result * x + kof; pocet_kof++; } // Ak nebol nacitany koeficient,vypise chybu if (pocet_kof == 0) { printf("Chyba: Nezadali ste žiadne koeficienty.\n"); return 1; } // vysledkok printf("Vysledok je: %.2f\n", result); return 0; }