Language: C

#include <stdio.h>
#define START "{"
#define END "}"
#define start "("
#define end ")"
#define br "\n"
typedef struct START
  int p,l,r; /* parent,left child,right sibling */
END Node;
Node T[100000];
int depthstartintend;
int PrintChildstartintend;
void Printstartintend;
int mainstartend
START
  int n,i,j,c,id,k,pre;
  scanfstart"%d",&nend;
  forstarti=0;i<n;i++end
    START
      T[i].p = T[i].l = T[i].r = -1;
    END
  forstarti=0;i<n;i++end
    START
      scanfstart"%d %d",&id,&kend;
      forstartj=0;j<k;j++end
    START
      scanfstart"%d",&cend;
      T[c].p=id;
      ifstartj==0end T[id].l = c;
      else T[pre].r = c;
      pre = c;
    END
    END
  forstarti=0;i<n;i++end
    START
      Printstartiend;
    END
  return 0;
END
void Printstartint idend
START
  int i;
  printfstart"node %d: parent = %d, depth = %d, ",id,T[id].p,depthstartidendend;
  ifstartT[id].p == -1end printfstart"root, ["end;
  else ifstartT[id].l == -1end printfstart"leaf, ["end;
  else printfstart"internal node, ["end;
  PrintChildstartT[id].lend;
  printfstart"]\n"end;
END
int PrintChildstartint idend
START
  ifstartid == -1end return 0;
  ifstartT[id].r == -1endprintfstart"%d",idend;
  else
    START
      printfstart"%d, ",idend;
      PrintChildstartT[id].rend;
    END
  return 0;
END
int depthstartint idend
START
  ifstartT[id].p == -1end return 0;
  return 1+depthstartT[id].pend;
END

Compiler output:
main.c:2:15: error: expected '{' before string constant
    2 | #define START "{"
      |               ^~~
main.c:7:16: note: in expansion of macro 'START'
    7 | typedef struct START
      |                ^~~~~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:9:1: note: in expansion of macro 'END'
    9 | END Node;
      | ^~~
main.c:10:1: error: unknown type name 'Node'
   10 | Node T[100000];
      | ^~~~
main.c:2:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
    2 | #define START "{"
      |               ^~~
main.c:15:1: note: in expansion of macro 'START'
   15 | START
      | ^~~~~
main.c:17:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
   17 |   scanfstart"%d",&nend;
      |             ^~~~
main.c:18:3: warning: data definition has no type or storage class
   18 |   forstarti=0;i<n;i++end
      |   ^~~~~~~~~
main.c:18:3: error: type defaults to 'int' in declaration of 'forstarti' [-Wimplicit-int]
main.c:18:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   18 |   forstarti=0;i<n;i++end
      |                ^
main.c:18:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   18 |   forstarti=0;i<n;i++end
      |                    ^~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:21:5: note: in expansion of macro 'END'
   21 |     END
      |     ^~~
main.c:22:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   22 |   forstarti=0;i<n;i++end
      |                ^
main.c:22:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   22 |   forstarti=0;i<n;i++end
      |                    ^~
main.c:25:7: warning: data definition has no type or storage class
   25 |       forstartj=0;j<k;j++end
      |       ^~~~~~~~~
main.c:25:7: error: type defaults to 'int' in declaration of 'forstartj' [-Wimplicit-int]
main.c:25:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   25 |       forstartj=0;j<k;j++end
      |                    ^
main.c:25:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   25 |       forstartj=0;j<k;j++end
      |                        ^~
main.c:28:9: error: 'c' undeclared here (not in a function)
   28 |       T[c].p=id;
      |         ^
main.c:28:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   28 |       T[c].p=id;
      |           ^
main.c:29:17: error: exponent has no digits
   29 |       ifstartj==0end T[id].l = c;
      |                 ^~~~
main.c:29:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
   29 |       ifstartj==0end T[id].l = c;
      |               ^~
main.c:30:7: error: expected identifier or '(' before 'else'
   30 |       else T[pre].r = c;
      |       ^~~~
main.c:31:7: warning: data definition has no type or storage class
   31 |       pre = c;
      |       ^~~
main.c:31:7: error: type defaults to 'int' in declaration of 'pre' [-Wimplicit-int]
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:32:5: note: in expansion of macro 'END'
   32 |     END
      |     ^~~
main.c:34:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   34 |   forstarti=0;i<n;i++end
      |                ^
main.c:34:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   34 |   forstarti=0;i<n;i++end
      |                    ^~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:37:5: note: in expansion of macro 'END'
   37 |     END
      |     ^~~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:39:1: note: in expansion of macro 'END'
   39 | END
      | ^~~
main.c:43:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
   43 |   printfstart"node %d: parent = %d, depth = %d, ",id,T[id].p,depthstartidendend;
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:44:12: error: 'id' undeclared here (not in a function)
   44 |   ifstartT[id].p == -1end printfstart"root, ["end;
      |            ^~
main.c:44:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   44 |   ifstartT[id].p == -1end printfstart"root, ["end;
      |               ^
main.c:44:22: error: exponent has no digits
   44 |   ifstartT[id].p == -1end printfstart"root, ["end;
      |                      ^~~~
main.c:45:3: error: expected identifier or '(' before 'else'
   45 |   else ifstartT[id].l == -1end printfstart"leaf, ["end;
      |   ^~~~
main.c:45:27: error: exponent has no digits
   45 |   else ifstartT[id].l == -1end printfstart"leaf, ["end;
      |                           ^~~~
main.c:46:3: error: expected identifier or '(' before 'else'
   46 |   else printfstart"internal node, ["end;
      |   ^~~~
main.c:47:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   47 |   PrintChildstartT[id].lend;
      |                       ^
main.c:48:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
   48 |   printfstart"]\n"end;
      |              ^~~~~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:49:1: note: in expansion of macro 'END'
   49 | END
      | ^~~
main.c:52:17: error: exponent has no digits
   52 |   ifstartid == -1end return 0;
      |                 ^~~~
main.c:53:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   53 |   ifstartT[id].r == -1endprintfstart"%d",idend;
      |               ^
main.c:53:22: error: exponent has no digits
   53 |   ifstartT[id].r == -1endprintfstart"%d",idend;
      |                      ^~~~~~~~~~~~~~~
main.c:54:3: error: expected identifier or '(' before 'else'
   54 |   else
      |   ^~~~
main.c:57:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   57 |       PrintChildstartT[id].rend;
      |                           ^
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:58:5: note: in expansion of macro 'END'
   58 |     END
      |     ^~~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:60:1: note: in expansion of macro 'END'
   60 | END
      | ^~~
main.c:63:22: error: exponent has no digits
   63 |   ifstartT[id].p == -1end return 0;
      |                      ^~~~
main.c:64:3: error: expected identifier or '(' before 'return'
   64 |   return 1+depthstartT[id].pend;
      |   ^~~~~~
main.c:3:13: error: expected identifier or '(' before string constant
    3 | #define END "}"
      |             ^~~
main.c:65:1: note: in expansion of macro 'END'
   65 | END
      | ^~~