From 6ce2baa0eb812a65e906e125a371ae43ef681afa Mon Sep 17 00:00:00 2001 From: ov075wu Date: Wed, 22 Oct 2025 00:03:16 +0200 Subject: [PATCH] refresh --- a1/program.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index 3dab280..328cba5 100644 --- a/a1/program.c +++ b/a1/program.c @@ -80,7 +80,25 @@ int main() { } if (!chyba && vrch >= 0) { - printf("Unclosed bracket %c at the end\n", zasobnik[vrch]); + char expected; + switch (zasobnik[vrch]) { + case '(': + expected = ')'; + break; + case '[': + expected = ']'; + break; + case '{': + expected = '}'; + break; + case '<': + expected = '>'; + break; + default: + expected = '?'; + break; + } + printf("Missing closing brackets: %c\n", expected); chyba = 1; }