Language: C

#include<stdio.h>

typedef struct{
  int id;
  int r;
  int l;
  int deg;
  int s;
  int parent;
  int dep;
  int h;
}Tree;

main(){
  int a,i,j,g,x,y,count,max;
  Tree node[25];
  scanf("%d",&g);
  for(i=0;i<g;i++){
    scanf("%d",&a);
    node[a].id=a;
    scanf("%d%d",&node[a].l,&node[a].r);
  }
  
   for(i=0;i<g;i++){
     count=0;
    for(j=0;j<g;j++){
      if(node[i].id==node[j].l || node[i].id == node[j].r){
	  node[i].parent=node[j].id;
          count++;
	  break;
      }
      if(count>0)break;
      else node[i].parent = -1;
    }}

   for(i=0;i<g;i++){
     for(j=1;j<g;j++){
       if(node[i].parent == -1)node[i].s =-1;
       else if(node[i].parent == node[j].parent){
	 node[i].s =node[j].id;
	 node[j].s =node[i].id;
	 break;
         else node[i].s=-1;
       }
	}}

   for(i=0;i<g;i++){
     if(node[i].l==-1 && node[i].r==-1)node[i].deg=0;
     else if(node[i].l >=0 && node[i].r>=0)node[i].deg=2;
     else node[i].deg=1;
   }

   for(i=0;i<g;i++){
    node[i].dep=0;
    if(node[i].parent==-1)continue;
    if(node[i].parent>=0)node[i].dep++;
    x=node[i].parent;
    while(1){
      if(node[x].parent>=0){
	node[i].dep++;
	x = node[x].parent;
      }
      else  break;
    }
  }
   max = -999;
   for(i=0;i<g;i++){
     if(max<node[i].dep)max=node[i].dep;}

   for(i=0;i<g;i++){
     node[i].h=0;
     if(node[i].deg==0)continue;
     else{
       x = node[i].l;
       y = node[i].r;
       while(1){
	 if(node[x].deg>0 && node[y].deg>0){
	   node[i].h = max - node[i].dep;
	 break;
	 }
	 else if(node[x].deg==0 && node[y].deg == 0){
	   node[i].h++;
	   break;
	 }
	 else if(node[x].deg>0 && node[y].deg == 0){
	   node[i].h++;
	   x = node[x].l;
	   y = node[x].r;
	 }
	  else if(node[x].deg==0 && node[y].deg>0){
	   node[i].h++;
	   x = node[y].l;
	   y = node[y].r;
	 }
       }}}
	 
       
   for(i=0;i<g;i++){
     printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",node[i].id,node[i].parent,node[i].s,node[i].deg,node[i].dep,node[i].h);
   if(node[i].dep==0)printf("root\n");
   else if(node[i].h==0)printf("leaf\n");
   else printf("internal node\n");
   
   }
   return 0;
}

Compiler output:
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
   14 | main(){
      | ^~~~
main.c: In function 'main':
main.c:43:10: error: expected '}' before 'else'
   43 |          else node[i].s=-1;
      |          ^~~~
main.c: At top level:
main.c:47:4: error: expected identifier or '(' before 'for'
   47 |    for(i=0;i<g;i++){
      |    ^~~
main.c:47:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   47 |    for(i=0;i<g;i++){
      |             ^
main.c:47:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   47 |    for(i=0;i<g;i++){
      |                 ^~
main.c:53:4: error: expected identifier or '(' before 'for'
   53 |    for(i=0;i<g;i++){
      |    ^~~
main.c:53:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   53 |    for(i=0;i<g;i++){
      |             ^
main.c:53:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   53 |    for(i=0;i<g;i++){
      |                 ^~
main.c:66:4: warning: data definition has no type or storage class
   66 |    max = -999;
      |    ^~~
main.c:66:4: error: type defaults to 'int' in declaration of 'max' [-Wimplicit-int]
main.c:67:4: error: expected identifier or '(' before 'for'
   67 |    for(i=0;i<g;i++){
      |    ^~~
main.c:67:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   67 |    for(i=0;i<g;i++){
      |             ^
main.c:67:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   67 |    for(i=0;i<g;i++){
      |                 ^~
main.c:70:4: error: expected identifier or '(' before 'for'
   70 |    for(i=0;i<g;i++){
      |    ^~~
main.c:70:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   70 |    for(i=0;i<g;i++){
      |             ^
main.c:70:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   70 |    for(i=0;i<g;i++){
      |                 ^~
main.c:98:4: error: expected identifier or '(' before 'for'
   98 |    for(i=0;i<g;i++){
      |    ^~~
main.c:98:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   98 |    for(i=0;i<g;i++){
      |             ^
main.c:98:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   98 |    for(i=0;i<g;i++){
      |                 ^~
main.c:105:4: error: expected identifier or '(' before 'return'
  105 |    return 0;
      |    ^~~~~~
main.c:106:1: error: expected identifier or '(' before '}' token
  106 | }
      | ^