Language: C

#include<stdio.h>

typedef struct Node{
  int id;
  int depth = 0;
  int parent = -1;
  int r = 0;
  int k;
  int a[100];
};

int main(){
  int i,l;
  Node c[100000];

  scanf("%d",&l);
  for(i = 0; i < l; i++){
    scanf("%d%d",&c[i].id,&c[i].k);
    if(c[i].k == 0) c[i].r = 2; 
    for(j = 0; j < c[i].k; j++){
      scanf("%d",&c[i].a[j]);
      c[c[i].a[j]].r = 1;
      c[c[i].a[j]].depth++;
      c[c[i].a[j]].parent = c[i].id;
    }
  }

  for(i = 0; i < l; i++){
    printf("node %d: parent = %d, depth = %d, ",c[i].id,c[i].parent,c.[i].depth);
    if(c[i].r == 0) printf("root, [");
    else if(c[i].r == 1) printf("internal node, [");
    else printf("leaf, [");

    if(c[i].r != 2){
      for(j = 0; j < c[i].k - 1; j++)
	printf("%d,",c[i].a[j]);
      printf(" %d",c[i].a[c[i].k - 1]);
    }
    printf("];");
  }
  
  
  return 0;
}




Compiler output:
main.c:5:13: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
    5 |   int depth = 0;
      |             ^
main.c:10:1: warning: useless storage class specifier in empty declaration
   10 | };
      | ^
main.c: In function 'main':
main.c:14:3: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   14 |   Node c[100000];
      |   ^~~~
      |   struct 
main.c:18:23: error: request for member 'id' in something not a structure or union
   18 |     scanf("%d%d",&c[i].id,&c[i].k);
      |                       ^
main.c:18:32: error: request for member 'k' in something not a structure or union
   18 |     scanf("%d%d",&c[i].id,&c[i].k);
      |                                ^
main.c:19:12: error: request for member 'k' in something not a structure or union
   19 |     if(c[i].k == 0) c[i].r = 2;
      |            ^
main.c:19:25: error: request for member 'r' in something not a structure or union
   19 |     if(c[i].k == 0) c[i].r = 2;
      |                         ^
main.c:20:9: error: 'j' undeclared (first use in this function)
   20 |     for(j = 0; j < c[i].k; j++){
      |         ^
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:24: error: request for member 'k' in something not a structure or union
   20 |     for(j = 0; j < c[i].k; j++){
      |                        ^
main.c:21:23: error: request for member 'a' in something not a structure or union
   21 |       scanf("%d",&c[i].a[j]);
      |                       ^
main.c:22:13: error: request for member 'a' in something not a structure or union
   22 |       c[c[i].a[j]].r = 1;
      |             ^
main.c:23:13: error: request for member 'a' in something not a structure or union
   23 |       c[c[i].a[j]].depth++;
      |             ^
main.c:24:13: error: request for member 'a' in something not a structure or union
   24 |       c[c[i].a[j]].parent = c[i].id;
      |             ^
main.c:24:33: error: request for member 'id' in something not a structure or union
   24 |       c[c[i].a[j]].parent = c[i].id;
      |                                 ^
main.c:29:53: error: request for member 'id' in something not a structure or union
   29 |     printf("node %d: parent = %d, depth = %d, ",c[i].id,c[i].parent,c.[i].depth);
      |                                                     ^
main.c:29:61: error: request for member 'parent' in something not a structure or union
   29 |     printf("node %d: parent = %d, depth = %d, ",c[i].id,c[i].parent,c.[i].depth);
      |                                                             ^
main.c:29:71: error: expected identifier before '[' token
   29 |     printf("node %d: parent = %d, depth = %d, ",c[i].id,c[i].parent,c.[i].depth);
      |                                                                       ^
main.c:30:12: error: request for member 'r' in something not a structure or union
   30 |     if(c[i].r == 0) printf("root, [");
      |            ^
main.c:31:17: error: request for member 'r' in something not a structure or union
   31 |     else if(c[i].r == 1) printf("internal node, [");
      |                 ^
main.c:34:12: error: request for member 'r' in something not a structure or union
   34 |     if(c[i].r != 2){
      |            ^
main.c:35:26: error: request for member 'k' in something not a structure or union
   35 |       for(j = 0; j < c[i].k - 1; j++)
      |                          ^
main.c:36:26: error: request for member 'a' in something not a structure or union
   36 |         printf("%d,",c[i].a[j]);
      |                          ^
main.c:37:24: error: request for member 'a' in something not a structure or union
   37 |       printf(" %d",c[i].a[c[i].k - 1]);
      |                        ^
main.c:37:31: error: request for member 'k' in something not a structure or union
   37 |       printf(" %d",c[i].a[c[i].k - 1]);
      |                               ^