From f9711b5aee71a929271ba214ee55cac333ba1ecd Mon Sep 17 00:00:00 2001 From: VIliam Date: Thu, 7 Mar 2024 22:38:58 +0100 Subject: [PATCH] cv3 --- cv3/program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cv3/program.c b/cv3/program.c index f2bbd62..ee1782c 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -14,6 +14,7 @@ int main() { char line[MAX_LINE_LENGTH]; double result = 0; double x; + int lineNumber = 1; if (fgets(line, MAX_LINE_LENGTH, stdin) == NULL || !IsValidNumber(line)) { printf("Nepodarilo sa nacitat zaklad x\n"); @@ -25,10 +26,11 @@ int main() { while (fgets(line, MAX_LINE_LENGTH, stdin) != NULL && IsValidNumber(line)) { double coefficient = strtod(line, NULL); result = result * x + coefficient; + lineNumber++; } if (line[0] != '\n') { - printf("Nepodarilo sa nacitat koeficient polynomu\n"); + printf("Nepodarilo sa nacitat polynom na %d mieste\n", lineNumber); return 1; }