From 523b0273e6190874ed83f78565bf79b260c39972 Mon Sep 17 00:00:00 2001 From: Yurii Yakovenko Date: Mon, 14 Oct 2024 20:24:44 +0000 Subject: [PATCH] Update cv3/program.c --- cv3/program.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 30ad455..255cf7c 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -2,8 +2,8 @@ #include #include #include -///@ -#define STACK_SIZE 500 +//// @ +#define STACK_SIZE 11 struct Stack { @@ -89,7 +89,9 @@ int main() else { if(isdigit(c)) + { rez=atof(buf); + } else { err=1; @@ -99,6 +101,12 @@ int main() if(!err) { + if(count_stack(&mystack)==STACK_SIZE) + { + printf("full stack\n"); + err=4; + break; + } push_stack(&mystack, rez); print_stack(&mystack); }