This commit is contained in:
Nataliia Kobryn 2025-10-19 23:51:12 +02:00
parent a4eb45cd82
commit 559203566a
2 changed files with 1 additions and 5 deletions

BIN
a1/prog

Binary file not shown.

View File

@ -80,11 +80,7 @@ int main() {
} }
char c = input[err - 1]; char c = input[err - 1];
if (c == ')' || c == ']' || c == '}' || c == '>') { if (c == ')' || c == ']' || c == '}' || c == '>') {
if (top == -1) { printf("Crossed bracket %c in %d, expected %c\n", c, err-1, getExpectedClosing(stack[top]));
printf("Unexpected closing bracket %c in %d\n", c, err-1);
} else {
printf("Crossed bracket %c in %d, expected %c\n", c, err-1, getExpectedClosing(stack[top]));
}
} else { } else {
printf("Unclosed bracket %c in %d\n", stack[top], err-1); printf("Unclosed bracket %c in %d\n", stack[top], err-1);
} }