invert output order a1

This commit is contained in:
Ivan Leichenko 2024-10-31 18:46:56 +01:00
parent 1585f18112
commit 206c26a2cf

View File

@ -54,7 +54,7 @@ int main()
memset(input, 0, len);
sprintf(input,"Missing closing brackets: ");
len = strlen(input);
for (int i = 0; i <= top; i++)
for (int i = top; i >= 0; i--)
{
input[len++] = (stack[i] == '(' ? ')' : stack[i] == '{' ? '}' : stack[i] == '[' ? ']' : '>');
}