Обновить cv3/program.c

This commit is contained in:
Yevhen Kozirovskyi 2024-10-17 16:49:26 +00:00
parent 276b7f7ea1
commit 8c3c003af9

View File

@ -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++) {