This commit is contained in:
mr314ot 2025-10-14 13:27:43 +02:00
parent 4f7ac8268e
commit bbc798be03

View File

@ -57,12 +57,12 @@ int main(){
} }
else if (isClosing(c)){ else if (isClosing(c)){
if (top < 0){ if (top < 0){
printf("Unexpected closing bracket %c in %d\n", c, i+1); printf("Unexpected closing bracket %c in %d\n", c, i);
return 0; return 0;
} }
char last = stack[top--]; char last = stack[top--];
if (expectedClosing(last) != c){ if (expectedClosing(last) != c){
printf("Crossed bracket %c in %d, expected %c\n", c, i+1, expectedClosing(last)); printf("Crossed bracket %c in %d, expected %c\n", c, i, expectedClosing(last));
return 0; return 0;
} }
} }