From 6c5f1b24092ca2ccc8f70ef8968658f082ba977a Mon Sep 17 00:00:00 2001 From: Marat Izmailov Date: Thu, 24 Oct 2024 10:40:23 +0000 Subject: [PATCH] Update a1/program.c --- a1/program.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index ff28231..3d855e3 100644 --- a/a1/program.c +++ b/a1/program.c @@ -69,7 +69,11 @@ int main() { // Проверка на незакрытые скобки if (top != -1) { - printf("Missing closing brackets: %c\n", matchingCloseBracket(stack[top])); + printf("Missing closing brackets: "); + for (int i = top; i >= 0; i--) { + printf("%c", matchingCloseBracket(stack[i])); + } + printf("\n"); return 0; // Ожидается код завершения 0 }