Обновить cv3/program.c
This commit is contained in:
parent
276b7f7ea1
commit
8c3c003af9
@ -47,6 +47,10 @@ int main() {
|
||||
char* konec;
|
||||
double chislo = strtod(bufer, &konec);
|
||||
if (*konec == '\n' && *bufer != '\n' && *bufer != ' ') {
|
||||
if (konec - bufer == 1) {
|
||||
printf("bad input\n");
|
||||
exit(1);
|
||||
}
|
||||
push(&stek, chislo);
|
||||
} else if (strcmp(konec, "+\n") == 0) {
|
||||
if (isEmpty(&stek)) {
|
||||
@ -103,7 +107,7 @@ int main() {
|
||||
}
|
||||
push(&stek, a / b);
|
||||
} else {
|
||||
printf("no input\n");
|
||||
printf("bad input\n");
|
||||
exit(1);
|
||||
}
|
||||
for (int i = 0; i < stek.vershina; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user