Language: C

include <stdio.h>
#define N 100000
 
typedef struct{
  int id,p,d,k;
  int jisu[1000];
}Node;
// tree{0, 1, 2, 3, 4, 5, 6}                                                                  
// tree                                                                                       
Node tree[N];
 
int jisu(int,int);
 
int kaisu = 0,n;
main(){
 
  int j,i,nodeb;
 
  scanf("%d",&n);
 
  for(j = 0 ; j < n; j++){
    tree[j].d = 0;
    tree[j].p = -2;
    tree[j].k = 0;
  }
 
  for(j = 0 ; j < n; j++){
    scanf("%d",&nodeb);
    // 入力されたノード番号のIDをtreeの”入力されたノード番号”番目に設定する                   
    tree[nodeb].id = nodeb;
    scanf("%d",&tree[nodeb].k);
    jisu(tree[nodeb].k,nodeb);
  }
 
  for(j = 0 ; j < n; j++ ){
    if(tree[j].p == -2)tree[j].p = -1;
     printf("node %d: parent = %d, depth = %d,",tree[j].id,tree[j].p,tree[j].d);
 
    if(tree[j].p == -1){
      printf(" root, [");
      for(i = 0 ; i < tree[j].k ; i++ ){
        printf("%d",tree[j].jisu[i]);
        if(i != tree[j].k - 1){
          printf(", ");
        }
 
      }
      printf("]");
    }
 
    //&& tree[j].id != 0                                                                      
 
    if(tree[j].k == 0 && tree[j].p != -1){
      printf(" leaf, []");
    }
 
    if(tree[j].k != 0 && tree[j].p != -1){
      printf(" internal node, [");
     for(i = 0 ; i < tree[j].k ; i++ ){
        printf("%d",tree[j].jisu[i]);
        if(i != tree[j].k - 1){
          printf(", ");
        }
     }
      printf("]");
    }
 
    printf("\n");
  }
 
  return 0;
 
}
 
 
 
 
int jisu(int k,int now){
  int ii,g;
 
    for(ii = 0 ; ii < k; ii++){
      scanf("%d",&tree[now].jisu[ii]);
      if(tree[now].jisu[ii] == 0 && tree[tree[now].jisu[ii]].d != 0){
        tree[now].p = -1;
      }
      //次数に親のidいれる                                                                    
      tree[tree[now].jisu[ii]].p = now;
      tree[tree[now].jisu[ii]].d = tree[now].d + 1;
 
    for(g = 0 ; g < n; g++){
      if(tree[g].p == -1 || tree[g].p == -2) continue;
      if(tree[g].d == tree[tree[g].p].d) tree[g].d++;
    }
 
    }
    return 1;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c:7:2: warning: data definition has no type or storage class
    7 | }Node;
      |  ^~~~
main.c:7:2: error: type defaults to 'int' in declaration of 'Node' [-Wimplicit-int]
main.c:10:1: error: unknown type name 'Node'
   10 | Node tree[N];
      | ^~~~
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
   15 | main(){
      | ^~~~
main.c: In function 'main':
main.c:19:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   19 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:19:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   19 |   scanf("%d",&n);
      |   ^~~~~
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:22:12: error: request for member 'd' in something not a structure or union
   22 |     tree[j].d = 0;
      |            ^
main.c:23:12: error: request for member 'p' in something not a structure or union
   23 |     tree[j].p = -2;
      |            ^
main.c:24:12: error: request for member 'k' in something not a structure or union
   24 |     tree[j].k = 0;
      |            ^
main.c:30:16: error: request for member 'id' in something not a structure or union
   30 |     tree[nodeb].id = nodeb;
      |                ^
main.c:31:28: error: request for member 'k' in something not a structure or union
   31 |     scanf("%d",&tree[nodeb].k);
      |                            ^
main.c:32:21: error: request for member 'k' in something not a structure or union
   32 |     jisu(tree[nodeb].k,nodeb);
      |                     ^
main.c:36:15: error: request for member 'p' in something not a structure or union
   36 |     if(tree[j].p == -2)tree[j].p = -1;
      |               ^
main.c:36:31: error: request for member 'p' in something not a structure or union
   36 |     if(tree[j].p == -2)tree[j].p = -1;
      |                               ^
main.c:37:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   37 |      printf("node %d: parent = %d, depth = %d,",tree[j].id,tree[j].p,tree[j].d);
      |      ^~~~~~
main.c:37:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:37:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:37:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:37:56: error: request for member 'id' in something not a structure or union
   37 |      printf("node %d: parent = %d, depth = %d,",tree[j].id,tree[j].p,tree[j].d);
      |                                                        ^
main.c:37:67: error: request for member 'p' in something not a structure or union
   37 |      printf("node %d: parent = %d, depth = %d,",tree[j].id,tree[j].p,tree[j].d);
      |                                                                   ^
main.c:37:77: error: request for member 'd' in something not a structure or union
   37 |      printf("node %d: parent = %d, depth = %d,",tree[j].id,tree[j].p,tree[j].d);
      |                                                                             ^
main.c:39:15: error: request for member 'p' in something not a structure or union
   39 |     if(tree[j].p == -1){
      |               ^
main.c:41:30: error: request for member 'k' in something not a structure or union
   41 |       for(i = 0 ; i < tree[j].k ; i++ ){
      |                              ^
main.c:42:28: error: request for member 'jisu' in something not a structure or union
   42 |         printf("%d",tree[j].jisu[i]);
      |                            ^
main.c:43:24: error: request for member 'k' in something not a structure or union
   43 |         if(i != tree[j].k - 1){
      |                        ^
main.c:53:15: error: request for member 'k' in something not a structure or union
   53 |     if(tree[j].k == 0 && tree[j].p != -1){
      |               ^
main.c:53:33: error: request for member 'p' in something not a structure or union
   53 |     if(tree[j].k == 0 && tree[j].p != -1){
      |                                 ^
main.c:57:15: error: request for member 'k' in something not a structure or union
   57 |     if(tree[j].k != 0 && tree[j].p != -1){
      |               ^
main.c:57:33: error: request for member 'p' in something not a structure or union
   57 |     if(tree[j].k != 0 && tree[j].p != -1){
      |                                 ^
main.c:59:29: error: request for member 'k' in something not a structure or union
   59 |      for(i = 0 ; i < tree[j].k ; i++ ){
      |                             ^
main.c:60:28: error: request for member 'jisu' in something not a structure or union
   60 |         printf("%d",tree[j].jisu[i]);
      |                            ^
main.c:61:24: error: request for member 'k' in something not a structure or union
   61 |         if(i != tree[j].k - 1){
      |                        ^
main.c: In function 'jisu':
main.c:82:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   82 |       scanf("%d",&tree[now].jisu[ii]);
      |       ^~~~~
main.c:82:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:82:28: error: request for member 'jisu' in something not a structure or union
   82 |       scanf("%d",&tree[now].jisu[ii]);
      |                            ^
main.c:83:19: error: request for member 'jisu' in something not a structure or union
   83 |       if(tree[now].jisu[ii] == 0 && tree[tree[now].jisu[ii]].d != 0){
      |                   ^
main.c:83:51: error: request for member 'jisu' in something not a structure or union
   83 |       if(tree[now].jisu[ii] == 0 && tree[tree[now].jisu[ii]].d != 0){
      |                                                   ^
main.c:84:18: error: request for member 'p' in something not a structure or union
   84 |         tree[now].p = -1;
      |                  ^
main.c:87:21: error: request for member 'jisu' in something not a structure or union
   87 |       tree[tree[now].jisu[ii]].p = now;
      |                     ^
main.c:88:21: error: request for member 'jisu' in something not a structure or union
   88 |       tree[tree[now].jisu[ii]].d = tree[now].d + 1;
      |                     ^
main.c:88:45: error: request for member 'd' in something not a structure or union
   88 |       tree[tree[now].jisu[ii]].d = tree[now].d + 1;
      |                                             ^
main.c:91:17: error: request for member 'p' in something not a structure or union
   91 |       if(tree[g].p == -1 || tree[g].p == -2) continue;
      |                 ^
main.c:91:36: error: request for member 'p' in something not a structure or union
   91 |       if(tree[g].p == -1 || tree[g].p == -2) continue;
      |                                    ^
main.c:92:17: error: request for member 'd' in something not a structure or union
   92 |       if(tree[g].d == tree[tree[g].p].d) tree[g].d++;
      |                 ^
main.c:92:35: error: request for member 'p' in something not a structure or union
   92 |       if(tree[g].d == tree[tree[g].p].d) tree[g].d++;
      |                                   ^
main.c:92:49: error: request for member 'd' in something not a structure or union
   92 |       if(tree[g].d == tree[tree[g].p].d) tree[g].d++;
      |                                                 ^