This commit is contained in:
Bohdan Kapliuk 2024-10-27 22:55:47 +02:00
parent ae36a3dfe9
commit f44455c266

View File

@ -43,6 +43,10 @@ int main() {
} }
} }
if (x > 0) { if (x > 0) {
if (stack[x-1] == '{') expected = '}';
else if (stack[x-1] == '[') expected = ']';
else if (stack[x-1] == '(') expected = ')';
else if (stack[x-1] == '<') expected = '>';
printf("Missing closing brackets: %c\n", expected); printf("Missing closing brackets: %c\n", expected);
} else { } else {
printf("All brackets OK\n"); printf("All brackets OK\n");