25 lines
418 B
C
25 lines
418 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdbool.h>
|
|
|
|
int main() {
|
|
int scope = 0;
|
|
bool in_string = false;
|
|
bool escape_next = false;
|
|
|
|
char c;
|
|
while (read(STDIN_FILENO, &c, 1) > 0) {
|
|
putchar(c);
|
|
|
|
if (c == '{' || c == '[') {
|
|
scope++;
|
|
putchar('\n');
|
|
}
|
|
else if (c == '}' || c == ']') {
|
|
scope--;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|