trying
This commit is contained in:
parent
9b8a0a5f97
commit
90fbfe67c3
16
a1/program.c
16
a1/program.c
@ -193,30 +193,28 @@ void read_input(LinkedNode** head){
|
||||
|
||||
}
|
||||
if(*head != NULL){
|
||||
printf("Read: %sMissing closing brackets: ", buff);
|
||||
LinkedNode* ptr = *head;
|
||||
while(ptr){
|
||||
if(ptr->data == '['){
|
||||
printf("Read: %sMissing closing brackets: ]\n", buff);
|
||||
return;
|
||||
putchar(']');
|
||||
|
||||
}
|
||||
if(ptr->data == '('){
|
||||
printf("Read: %sMissing closing brackets: )\n", buff);
|
||||
return;
|
||||
putchar(')');
|
||||
|
||||
}
|
||||
if(ptr->data == '{'){
|
||||
printf("Read: %sMissing closing brackets: }\n", buff);
|
||||
return;
|
||||
|
||||
putchar('}');
|
||||
|
||||
}
|
||||
if(ptr->data == '<'){
|
||||
printf("Read: %sMissing closing brackets: >\n", buff);
|
||||
return;
|
||||
putchar('>');
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
putchar('\n');
|
||||
return;
|
||||
}
|
||||
printf("Read: %sAll brackets OK\n", buff);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user