Language: C

include <stdio.h>
#define N 100000
 
typedef struct{
  int id,parent,dep,deg,s,height,left,right,type;
  int jisu[50];
}Node;
 
int hhh = 0;
 
Node tree[N];
 
void jisu(int);
 
main(){
 
  int j,i,nodeb,n;
 
  scanf("%d",&n);
 
  for(i = 0 ; i < n; i++){
    tree[i].parent = -1;
    tree[i].dep = 0;
    tree[i].height = 1;
    tree[i].s = -1;
  }
 
  for(i = 0 ; i < n ; i++ ){
 
    scanf("%d",&nodeb);
 
    tree[nodeb].id = nodeb;
 
    scanf("%d",&tree[nodeb].left);
    scanf("%d",&tree[nodeb].right);

//                                                                                                                                                                                           
    tree[tree[nodeb].left].parent = nodeb;
    tree[tree[nodeb].left].s = tree[nodeb].right;
    //                                                                                                                                                                                           
    tree[tree[nodeb].right].parent = nodeb;
    tree[tree[nodeb].right].s =  tree[nodeb].left;
 
    jisu(nodeb);
 
  }
 
  for(i = n - 1 ; i >= 0; i--){
 
    if(tree[i].deg != 0 && tree[tree[i].right].height > tree[tree[i].left].height) tree[i].height = tree[tree[i].right].height + 1;
    else if(tree[i].deg != 0 && tree[tree[i].left].height > tree[tree[i].right].height) tree[i].height = tree[tree[i].left].height + 1;
 
  }
 
  for(i = 0 ; i < n; i++){
 
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
    if(tree[i].height == 0) printf("leaf\n");
    else if(tree[i].dep == 0) printf("root\n");
    else printf("internal node\n");
  }
 
  return 0;
 
}
 
 
void jisu(int now){
 
  if(tree[now].right != -1) tree[now].deg = 2;
  else {tree[now].deg = 0;
    tree[now].height = 0;
  }
 
  if(tree[now].parent != -1) tree[now].dep = tree[tree[now].parent].dep + 1;
 
  if(hhh <= tree[now].dep) hhh = tree[now].dep;
 
}

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:11:1: error: unknown type name 'Node'
   11 | 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 'parent' in something not a structure or union
   22 |     tree[i].parent = -1;
      |            ^
main.c:23:12: error: request for member 'dep' in something not a structure or union
   23 |     tree[i].dep = 0;
      |            ^
main.c:24:12: error: request for member 'height' in something not a structure or union
   24 |     tree[i].height = 1;
      |            ^
main.c:25:12: error: request for member 's' in something not a structure or union
   25 |     tree[i].s = -1;
      |            ^
main.c:32:16: error: request for member 'id' in something not a structure or union
   32 |     tree[nodeb].id = nodeb;
      |                ^
main.c:34:28: error: request for member 'left' in something not a structure or union
   34 |     scanf("%d",&tree[nodeb].left);
      |                            ^
main.c:35:28: error: request for member 'right' in something not a structure or union
   35 |     scanf("%d",&tree[nodeb].right);
      |                            ^
main.c:38:21: error: request for member 'left' in something not a structure or union
   38 |     tree[tree[nodeb].left].parent = nodeb;
      |                     ^
main.c:39:21: error: request for member 'left' in something not a structure or union
   39 |     tree[tree[nodeb].left].s = tree[nodeb].right;
      |                     ^
main.c:39:43: error: request for member 'right' in something not a structure or union
   39 |     tree[tree[nodeb].left].s = tree[nodeb].right;
      |                                           ^
main.c:41:21: error: request for member 'right' in something not a structure or union
   41 |     tree[tree[nodeb].right].parent = nodeb;
      |                     ^
main.c:42:21: error: request for member 'right' in something not a structure or union
   42 |     tree[tree[nodeb].right].s =  tree[nodeb].left;
      |                     ^
main.c:42:45: error: request for member 'left' in something not a structure or union
   42 |     tree[tree[nodeb].right].s =  tree[nodeb].left;
      |                                             ^
main.c:50:15: error: request for member 'deg' in something not a structure or union
   50 |     if(tree[i].deg != 0 && tree[tree[i].right].height > tree[tree[i].left].height) tree[i].height = tree[tree[i].right].height + 1;
      |               ^
main.c:50:40: error: request for member 'right' in something not a structure or union
   50 |     if(tree[i].deg != 0 && tree[tree[i].right].height > tree[tree[i].left].height) tree[i].height = tree[tree[i].right].height + 1;
      |                                        ^
main.c:50:69: error: request for member 'left' in something not a structure or union
   50 |     if(tree[i].deg != 0 && tree[tree[i].right].height > tree[tree[i].left].height) tree[i].height = tree[tree[i].right].height + 1;
      |                                                                     ^
main.c:50:91: error: request for member 'height' in something not a structure or union
   50 |     if(tree[i].deg != 0 && tree[tree[i].right].height > tree[tree[i].left].height) tree[i].height = tree[tree[i].right].height + 1;
      |                                                                                           ^
main.c:50:113: error: request for member 'right' in something not a structure or union
   50 |     if(tree[i].deg != 0 && tree[tree[i].right].height > tree[tree[i].left].height) tree[i].height = tree[tree[i].right].height + 1;
      |                                                                                                                 ^
main.c:51:20: error: request for member 'deg' in something not a structure or union
   51 |     else if(tree[i].deg != 0 && tree[tree[i].left].height > tree[tree[i].right].height) tree[i].height = tree[tree[i].left].height + 1;
      |                    ^
main.c:51:45: error: request for member 'left' in something not a structure or union
   51 |     else if(tree[i].deg != 0 && tree[tree[i].left].height > tree[tree[i].right].height) tree[i].height = tree[tree[i].left].height + 1;
      |                                             ^
main.c:51:73: error: request for member 'right' in something not a structure or union
   51 |     else if(tree[i].deg != 0 && tree[tree[i].left].height > tree[tree[i].right].height) tree[i].height = tree[tree[i].left].height + 1;
      |                                                                         ^
main.c:51:96: error: request for member 'height' in something not a structure or union
   51 |     else if(tree[i].deg != 0 && tree[tree[i].left].height > tree[tree[i].right].height) tree[i].height = tree[tree[i].left].height + 1;
      |                                                                                                ^
main.c:51:118: error: request for member 'left' in something not a structure or union
   51 |     else if(tree[i].deg != 0 && tree[tree[i].left].height > tree[tree[i].right].height) tree[i].height = tree[tree[i].left].height + 1;
      |                                                                                                                      ^
main.c:57:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |     ^~~~~~
main.c:57:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:57:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:57:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:57:96: error: request for member 'id' in something not a structure or union
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |                                                                                                ^
main.c:57:107: error: request for member 'parent' in something not a structure or union
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |                                                                                                           ^
main.c:57:122: error: request for member 's' in something not a structure or union
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |                                                                                                                          ^
main.c:57:132: error: request for member 'deg' in something not a structure or union
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |                                                                                                                                    ^
main.c:57:144: error: request for member 'dep' in something not a structure or union
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |                                                                                                                                                ^
main.c:57:156: error: request for member 'height' in something not a structure or union
   57 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent,tree[i].s,tree[i].deg,tree[i].dep,tree[i].height);
      |                                                                                                                                                            ^
main.c:58:15: error: request for member 'height' in something not a structure or union
   58 |     if(tree[i].height == 0) printf("leaf\n");
      |               ^
main.c:59:20: error: request for member 'dep' in something not a structure or union
   59 |     else if(tree[i].dep == 0) printf("root\n");
      |                    ^
main.c: In function 'jisu':
main.c:70:15: error: request for member 'right' in something not a structure or union
   70 |   if(tree[now].right != -1) tree[now].deg = 2;
      |               ^
main.c:70:38: error: request for member 'deg' in something not a structure or union
   70 |   if(tree[now].right != -1) tree[now].deg = 2;
      |                                      ^
main.c:71:18: error: request for member 'deg' in something not a structure or union
   71 |   else {tree[now].deg = 0;
      |                  ^
main.c:72:14: error: request for member 'height' in something not a structure or union
   72 |     tree[now].height = 0;
      |              ^
main.c:75:15: error: request for member 'parent' in something not a structure or union
   75 |   if(tree[now].parent != -1) tree[now].dep = tree[tree[now].parent]