Update 'a2/program.c'
This commit is contained in:
parent
9078d3a3c1
commit
69f2c49596
@ -86,7 +86,7 @@ int main(){
|
||||
|
||||
}
|
||||
else if(!find_pair(gettop(), line[i])){
|
||||
printf("Crossed bracket %c in %d, expected %c \n", line[i], i, r_bracket[j]);
|
||||
printf("Crossed bracket %c in %d, expected %c \n", line[i], i, r_bracket[f]);
|
||||
return 0;
|
||||
}
|
||||
else{
|
||||
@ -100,7 +100,6 @@ int main(){
|
||||
int begin = 0;
|
||||
int end = strlen(r_bracket);
|
||||
int temp;
|
||||
//printf("%s", b);
|
||||
while(begin < end){
|
||||
temp = r_bracket[begin];
|
||||
r_bracket[begin++] = r_bracket[--end];
|
||||
@ -113,7 +112,9 @@ int main(){
|
||||
else {
|
||||
printf("Missing closing brackets: %s\n", r_bracket);
|
||||
}
|
||||
|
||||
free(l_bracket);
|
||||
free(r_bracket);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user