This commit is contained in:
Matej Hajduk 2025-10-21 19:05:34 +02:00
parent 96b50c9610
commit f07770fe29

View File

@ -38,7 +38,7 @@ int main(void) {
} }
else if (ch == ')' || ch == '}' || ch == ']' || ch == '>') { else if (ch == ')' || ch == '}' || ch == ']' || ch == '>') {
if (top < 0) { if (top < 0) {
printf("Unexpected closing bracket %c in %d\n", ch, i); printf("Unexpected closing bracket %c in %d \n", ch, i);
ok = 0; ok = 0;
break; break;
} }
@ -46,7 +46,7 @@ int main(void) {
char last_open = stack[top]; char last_open = stack[top];
char expected = expected_close(last_open); char expected = expected_close(last_open);
if (ch != expected) { if (ch != expected) {
printf("Crossed bracket %c in %d, expected %c\n", ch, i, expected); printf("Crossed bracket %c in %d, expected %c \n", ch, i, expected);
ok = 0; ok = 0;
break; break;
} }