From 9d79f9d77b6cd773a76f989b8fcc767139f6fe71 Mon Sep 17 00:00:00 2001 From: VIliam Date: Thu, 31 Oct 2024 23:57:00 +0100 Subject: [PATCH] s --- a1/program.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index 22ab81e..05fae37 100644 --- a/a1/program.c +++ b/a1/program.c @@ -31,7 +31,11 @@ void check_brackets(const char *code) { if (top == -1) { printf("All brackets OK\n"); } else { - printf("Missing closing brackets: %c\n", stack[top -1]); + printf("Missing closing brackets: "); + while (top >= 0) { + printf("%c", stack[top--]); + } + printf("\n"); } }