Обновить cv3/program.c
This commit is contained in:
parent
f71ad133b9
commit
7806888c40
@ -47,10 +47,7 @@ int main() {
|
||||
while (fgets(bufer, sizeof(bufer), stdin) != NULL) {
|
||||
char* konec;
|
||||
double chislo = strtod(bufer, &konec);
|
||||
if (chislo == 0 && strcmp(bufer, "0\n") != 0) {
|
||||
printf("bad input\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (*konec == '\n' && *bufer != '\n' && *bufer != ' ') {
|
||||
push(&stek, chislo);
|
||||
} else if (strcmp(konec, "+\n") == 0) {
|
||||
@ -111,6 +108,7 @@ int main() {
|
||||
} else if (isalpha(konec[-1])) {
|
||||
printf("bad input\n");
|
||||
exit(1);
|
||||
return 0;
|
||||
} else {
|
||||
printf("bad input\n");
|
||||
exit(1);
|
||||
@ -122,4 +120,4 @@ int main() {
|
||||
}
|
||||
printf("no input\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user