This commit is contained in:
Anton Dolozin 2025-10-13 17:54:30 +02:00
parent 9b8a0a5f97
commit 90fbfe67c3

View File

@ -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);