refresh
This commit is contained in:
parent
baf5cd933f
commit
6ce2baa0eb
20
a1/program.c
20
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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user