a1 - 5
This commit is contained in:
parent
4f7ac8268e
commit
bbc798be03
@ -57,12 +57,12 @@ int main(){
|
||||
}
|
||||
else if (isClosing(c)){
|
||||
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;
|
||||
}
|
||||
char last = stack[top--];
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user