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);
 
    if(tree[nodeb].left == 0 && tree[nodeb].right == 0) continue;
 
    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;
    //    printf("[%d %d %d]\n",tree[i].id,i,tree[i].height);                                                                                                                                    
  }
 
  for(i = 0 ; i < n; i++){
    if(tree[i].parent == -1 && tree[i].deg != 0) {
      if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
    }
    if(tree[i].parent != -1) tree[i].dep = tree[tree[i].parent].dep + 1;
    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 && tree[i].parent != -1) 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].left != -1) tree[now].deg = 2;
  else if(tree[now].right == -1 && tree[now].left != -1) tree[now].deg = 1;
  else if(tree[now].right != -1 && tree[now].left == -1) tree[now].deg = 1;
  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:37:19: error: request for member 'left' in something not a structure or union
   37 |     if(tree[nodeb].left == 0 && tree[nodeb].right == 0) continue;
      |                   ^
main.c:37:44: error: request for member 'right' in something not a structure or union
   37 |     if(tree[nodeb].left == 0 && tree[nodeb].right == 0) continue;
      |                                            ^
main.c:39:21: error: request for member 'left' in something not a structure or union
   39 |     tree[tree[nodeb].left].parent = nodeb;
      |                     ^
main.c:41:21: error: request for member 'left' in something not a structure or union
   41 |     tree[tree[nodeb].left].s = tree[nodeb].right;
      |                     ^
main.c:41:43: error: request for member 'right' in something not a structure or union
   41 |     tree[tree[nodeb].left].s = tree[nodeb].right;
      |                                           ^
main.c:43:21: error: request for member 'right' in something not a structure or union
   43 |     tree[tree[nodeb].right].parent = nodeb;
      |                     ^
main.c:44:21: error: request for member 'right' in something not a structure or union
   44 |     tree[tree[nodeb].right].s =  tree[nodeb].left;
      |                     ^
main.c:44:45: error: request for member 'left' in something not a structure or union
   44 |     tree[tree[nodeb].right].s =  tree[nodeb].left;
      |                                             ^
main.c:51:15: error: request for member 'deg' in something not a structure or union
   51 |     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:40: error: request for member 'right' in something not a structure or union
   51 |     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:69: error: request for member 'left' in something not a structure or union
   51 |     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:91: error: request for member 'height' in something not a structure or union
   51 |     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:113: error: request for member 'right' in something not a structure or union
   51 |     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:52:20: error: request for member 'deg' in something not a structure or union
   52 |     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:52:45: error: request for member 'left' in something not a structure or union
   52 |     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:52:73: error: request for member 'right' in something not a structure or union
   52 |     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:52:96: error: request for member 'height' in something not a structure or union
   52 |     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:52:118: error: request for member 'left' in something not a structure or union
   52 |     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:15: error: request for member 'parent' in something not a structure or union
   57 |     if(tree[i].parent == -1 && tree[i].deg != 0) {
      |               ^
main.c:57:39: error: request for member 'deg' in something not a structure or union
   57 |     if(tree[i].parent == -1 && tree[i].deg != 0) {
      |                                       ^
main.c:58:22: error: request for member 'left' in something not a structure or union
   58 |       if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
      |                      ^
main.c:58:46: error: request for member 'height' in something not a structure or union
   58 |       if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
      |                                              ^
main.c:58:69: error: request for member 'right' in something not a structure or union
   58 |       if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
      |                                                                     ^
main.c:58:94: error: request for member 'height' in something not a structure or union
   58 |       if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
      |                                                                                              ^
main.c:58:110: error: request for member 'height' in something not a structure or union
   58 |       if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
      |                                                                                                              ^
main.c:58:127: error: request for member 'height' in something not a structure or union
   58 |       if(tree[tree[i].left].height == tree[i].height || tree[tree[i].right].height == tree[i].height) tree[i].height = tree[i].height + 1;
      |                                                                                                                               ^
main.c:60:15: error: request for member 'parent' in something not a structure or union
   60 |     if(tree[i].parent != -1) tree[i].dep = tree[tree[i].parent].dep + 1;
      |               ^
main.c:60:37: error: request for member 'dep' in something not a structure or union
   60 |     if(tree[i].parent != -1) tree[i].dep = tree[tree[i].parent].dep + 1;
      |                                     ^
main.c:60:56: error: request for member 'parent' in something not a structure or union
   60 |     if(tree[i].parent != -1) tree[i].dep = tree[tree[i].parent].dep + 1;
      |                                                        ^
main.c:61:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   61 |     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:61:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:61:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:61:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:61:96: error: request for member 'id' in something not a structure or union
   61 |     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",tree[i].id,tree[i].parent