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; }