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