From c253ae8605349e8880f4d2eb73f27e74f729b09b Mon Sep 17 00:00:00 2001 From: Yurii Yakovenko Date: Fri, 25 Oct 2024 20:43:05 +0000 Subject: [PATCH] Update a1/program.c --- a1/program.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/a1/program.c b/a1/program.c index 9ccb624..0303ea0 100644 --- a/a1/program.c +++ b/a1/program.c @@ -111,18 +111,21 @@ int main() i++; } - if(count_stack(&mystack)>0) + if(is_ok) { - printf("\nMissing closing brackets: "); - do - { + if(count_stack(&mystack)>0) + { + printf("\nMissing closing brackets: "); + do + { cs=pop_stack(&mystack); printf("%c", para(cs)); - }while(count_stack(&mystack)>0); - printf("\n"); - } - else if(is_ok) + }while(count_stack(&mystack)>0); + printf("\n"); + } + else printf("\nAll brackets OK\n"); + }