From efefdd89e15c039cd2042979080ff215ef00a293 Mon Sep 17 00:00:00 2001 From: Deinerovych Date: Wed, 16 Oct 2024 22:42:58 +0200 Subject: [PATCH] 40 --- cv3/program.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index ed5f2f2..48006f4 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -43,7 +43,7 @@ void push(float number) { if (stack_top < STACK_SIZE - 1) { stack[++stack_top] = number; } else { - printf("Error: stack overflow\n"); + printf("stack overflow\n"); exit(0); } } @@ -52,7 +52,7 @@ float pop() { if (stack_top >= 0) { return stack[stack_top--]; } else { - printf("Error: stack is empty\n"); + printf("stack is empty\n"); exit(0); } } @@ -95,7 +95,12 @@ int main() { push(result); print_stack(); } + else { + printf("bad input\n"); + return 0; + } } + printf("no input\n"); return 0;