Language: C

#include <stdio.h>
#define MAX 100000
struct Node{
  int depth,p;
};
Node cdepth[MAX];
Node getdepth(struct Node);
int main(){ 
  int zi[MAX],arr,num,child[MAX][MAX],mode[MAX],i,j,k,parent[MAX],depth[MAX];
  Node T[MAX];
  scanf("%d",&num); /*numはのーどの数*/
  for(i=0;i<num;i++){
    scanf("%d",&arr); /*node"arr"について記述*/
  scanf("%d",&zi[arr]);
  for(j=0;j<zi[arr];j++){
    scanf("%d",child[i][j]);/*idがiののーどの子供はjを次数分やる*/
  }
  }
    /*ここからぶんせき*/

    for(i=0;i<num;i++){
      mode[i]=1;
      if(zi[i]==0)
	mode[i]=0; /*mode[ID];0なら葉、1なら枝、2なら根*/
      parent[i]=-1;
	for(j=0;j<num;j++){
	    if(child[j][0]==i)
	      T[i].p=j
	}
	if(parent[i]==-1)
	  mode[i]=2;
    }
    for(i=0;i<num;i++){
      getdepth(T[i].p);
      depth[i]=cdepth;
      cdepth=0;
    }
    for(i=0;i<num;i++){
      printf("node %d: parent = %d, depth = %d, ",i,T[i].p,depth[i]);
      if(mode[i]==0)
	printf("leaf, [");
      else if(mode[i]==1)
	printf("internal node, [");
      else if(mode[i]==2)
	printf("root, [");
      if(zi!=0){
      for(j=0;j<zi[i]-1;j++){
	printf("%d, ",child[i][j]);
      }
      printf("%d]"child[i][zi[i]-1]);
      }
      else printf("[]")
	     printf("\n");
    }
      return 0;
}


      Node  getdepth(struct node d){
 if(d.p!=-1){
   cdepth++;
	return getdepth(T[i].p);
 }
 else 
return cdepth;
      }

Compiler output:
main.c:6:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    6 | Node cdepth[MAX];
      | ^~~~
      | struct 
main.c:7:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    7 | Node getdepth(struct Node);
      | ^~~~
      | struct 
main.c: In function 'main':
main.c:10:3: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   10 |   Node T[MAX];
      |   ^~~~
      |   struct 
main.c:28:19: error: request for member 'p' in something not a structure or union
   28 |               T[i].p=j
      |                   ^
main.c:28:23: error: expected ';' before '}' token
   28 |               T[i].p=j
      |                       ^
      |                       ;
   29 |         }
      |         ~              
main.c:34:20: error: request for member 'p' in something not a structure or union
   34 |       getdepth(T[i].p);
      |                    ^
main.c:35:15: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   35 |       depth[i]=cdepth;
      |               ^
main.c:36:13: error: assignment to expression with array type
   36 |       cdepth=0;
      |             ^
main.c:39:57: error: request for member 'p' in something not a structure or union
   39 |       printf("node %d: parent = %d, depth = %d, ",i,T[i].p,depth[i]);
      |                                                         ^
main.c:50:19: error: expected ')' before 'child'
   50 |       printf("%d]"child[i][zi[i]-1]);
      |             ~     ^~~~~
      |                   )
main.c:52:24: error: expected ';' before 'printf'
   52 |       else printf("[]")
      |                        ^
      |                        ;
   53 |              printf("\n");
      |              ~~~~~~     
main.c: At top level:
main.c:59:7: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   59 |       Node  getdepth(struct node d){
      |       ^~~~
      |       struct 
main.c:59:29: warning: 'struct node' declared inside parameter list will not be visible outside of this definition or declaration
   59 |       Node  getdepth(struct node d){
      |                             ^~~~
main.c:59:34: error: parameter 1 ('d') has incomplete type
   59 |       Node  getdepth(struct node d){
      |                      ~~~~~~~~~~~~^
main.c: In function 'getdepth':
main.c:61:10: error: lvalue required as increment operand
   61 |    cdepth++;
      |          ^~
main.c:62:25: error: 'T' undeclared (first use in this function)
   62 |         return getdepth(T[i].p);
      |                         ^
main.c:62:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:62:27: error: 'i' undeclared (first use in this function)
   62 |         return getdepth(T[i].p);
      |                           ^
main.c:65:8: error: returning 'int *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
   65 | return cdepth;
      |        ^~~~~~