missing all brackets a1

This commit is contained in:
Ivan Leichenko 2024-10-31 18:42:10 +01:00
parent 4dea0649d6
commit d7ee1284a2

View File

@ -51,7 +51,15 @@ int main()
if (top != -1)
{
printf("Missing closing brackets: %c\n", (stack[top] == '(' ? ')' : stack[top] == '{' ? '}' : stack[top] == '[' ? ']' : '>'));
memset(input, 0, len);
sprintf(input,"Missing closing brackets: ");
len = strlen(input);
for (int i = 0; i <= top; i++)
{
input[len++] = (stack[i] == '(' ? ')' : stack[i] == '{' ? '}' : stack[i] == '[' ? ']' : '>');
}
input[len] = 0;
printf("%s", input);
return 0;
}