This commit is contained in:
Jana Kapalková 2026-03-05 18:42:08 +01:00
parent 5293f097f7
commit b8597efbea

View File

@ -22,10 +22,10 @@ int main() {
return 0; return 0;
} }
assert(r != NULL); assert(r != NULL);
char *px = line; x = strtod(line, &endptr);
while (isspace((unsigned char)*px)) px++; char *p_check = line;
x = strtod(px, &endptr); while (isspace((unsigned char)*p_check)) p_check++;
if (px == endptr) { if (p_check == endptr) {
return 0; return 0;
} }
while (fgets(line, LINE_SIZE, stdin) != NULL) { while (fgets(line, LINE_SIZE, stdin) != NULL) {