Update cv3/program.c
This commit is contained in:
parent
7bd14359e4
commit
83c10a1b37
@ -52,7 +52,7 @@ int read(struct stack *s) {
|
|||||||
|
|
||||||
// Check for empty input
|
// Check for empty input
|
||||||
if (strcmp(temp, "\n") == 0) {
|
if (strcmp(temp, "\n") == 0) {
|
||||||
printf("no input\n");
|
printf("bad input\n");
|
||||||
exit(1); // Exit on empty input
|
exit(1); // Exit on empty input
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ int read(struct stack *s) {
|
|||||||
}
|
}
|
||||||
push_stack(s, result); // Push the result back onto the stack
|
push_stack(s, result); // Push the result back onto the stack
|
||||||
print_stack(s); // Print the stack after operation
|
print_stack(s); // Print the stack after operation
|
||||||
printf("no input\n"); // Print the "no input" message
|
printf("bad input\n"); // Print the "no input" message
|
||||||
exit(0); // Exit the program after the operation
|
exit(0); // Exit the program after the operation
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user