From 2b721e65f5506df4628fc9e5e584a1485fafe4da Mon Sep 17 00:00:00 2001 From: Denis Landa Date: Fri, 7 Mar 2025 00:22:43 +0100 Subject: [PATCH] 12 --- du2/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/du2/program.c b/du2/program.c index 66f9d51..56a998d 100644 --- a/du2/program.c +++ b/du2/program.c @@ -11,13 +11,13 @@ int main(){ float coefficients[50]; int count = 0; - if(fgets(line, LINE_SIZE, stdin) == NULL) { + if(fgets(line, LINE_SIZE, stdin) == NULL){ printf("Chyba: Nepodarilo sa nacitat hodnotu x.\n"); return 1; } x = strtof(line, NULL); - while (fgets(line, LINE_SIZE, stdin) != NULL) { + while (fgets(line, LINE_SIZE, stdin) != NULL){ if (strlen(line) == 1) break; float coef = strtof(line, NULL); @@ -30,7 +30,7 @@ int main(){ } float result = coefficients[0]; - for (int i = 1; i < count; i++) { + for (int i = 1; i < count; i++){ result = result * x + coefficients[i]; }