From f44455c2664c9510da7265425abb209fde18fedf Mon Sep 17 00:00:00 2001 From: Bohdan Kapliuk Date: Sun, 27 Oct 2024 22:55:47 +0200 Subject: [PATCH] a1 --- a1/program.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/a1/program.c b/a1/program.c index e7daa56..5e87a6f 100644 --- a/a1/program.c +++ b/a1/program.c @@ -43,6 +43,10 @@ int main() { } } if (x > 0) { + if (stack[x-1] == '{') expected = '}'; + else if (stack[x-1] == '[') expected = ']'; + else if (stack[x-1] == '(') expected = ')'; + else if (stack[x-1] == '<') expected = '>'; printf("Missing closing brackets: %c\n", expected); } else { printf("All brackets OK\n");