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){
|
if(*head != NULL){
|
||||||
|
printf("Read: %sMissing closing brackets: ", buff);
|
||||||
LinkedNode* ptr = *head;
|
LinkedNode* ptr = *head;
|
||||||
while(ptr){
|
while(ptr){
|
||||||
if(ptr->data == '['){
|
if(ptr->data == '['){
|
||||||
printf("Read: %sMissing closing brackets: ]\n", buff);
|
putchar(']');
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(ptr->data == '('){
|
if(ptr->data == '('){
|
||||||
printf("Read: %sMissing closing brackets: )\n", buff);
|
putchar(')');
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(ptr->data == '{'){
|
if(ptr->data == '{'){
|
||||||
printf("Read: %sMissing closing brackets: }\n", buff);
|
putchar('}');
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(ptr->data == '<'){
|
if(ptr->data == '<'){
|
||||||
printf("Read: %sMissing closing brackets: >\n", buff);
|
putchar('>');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
ptr = ptr->next;
|
ptr = ptr->next;
|
||||||
}
|
}
|
||||||
|
putchar('\n');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
printf("Read: %sAll brackets OK\n", buff);
|
printf("Read: %sAll brackets OK\n", buff);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user