From 13f41f9ec9f1c87d668edbb297a206740211850a Mon Sep 17 00:00:00 2001 From: Maksym Kovalchuk Date: Wed, 4 Mar 2026 15:35:59 +0000 Subject: [PATCH] Odstranit program.c --- program.c | 61 ------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 program.c diff --git a/program.c b/program.c deleted file mode 100644 index 72386ea..0000000 --- a/program.c +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include - -#define SIZE 256 -#define MAX 1000 - -int main() { - - char line[SIZE]; - char *end; - - double x; - double pole[MAX]; - int n = 0; - - /* nacitanie x */ - if (fgets(line, SIZE, stdin) == NULL) { - printf("Chyba: nepodarilo sa nacitat x.\n"); - return 1; - } - - x = strtod(line, &end); - - if (end == line) { - printf("Chyba: nepodarilo sa nacitat x.\n"); - return 1; - } - - /* nacitanie koeficientov */ - while (fgets(line, SIZE, stdin) != NULL) { - - if (line[0] == '\n') // prazdny riadok - break; - - pole[n] = strtod(line, &end); - - if (end == line) { - printf("Chyba: nepodarilo sa nacitat koeficient %d.\n", n); - return 1; - } - - n++; - } - - if (n == 0) { - printf("Chyba: nebol zadany ziadny koeficient.\n"); - return 1; - } - - /* Horner */ - double vysledok = pole[0]; - - for (int i = 1; i < n; i++) { - vysledok = vysledok * x + pole[i]; - } - - printf("%.2f\n", vysledok); - - return 0; -} \ No newline at end of file