Language: C++

#include<iostream>
using namespace std;
#define MAX 100005
#define NIL -1

struct Node { int p,l.r;}
 Node T[MAX];
 int n ,D[Max];
 
void print(int u) {
	int i,c;
	count << "node "<<u<<": ";
	count << "parent = " <<T[u].p << ", ";
	count << "depth = " << D[u] << "leaf, ";
	else if ( T[u].l == NIL) cout << "leaf, ";
	else cout << "internal node, ";
	
	cout << "[";

	for (i=0, c = T[u].l;c != NIL;++, c = T[c].r){
		if(i) cout << ", ";
		cout << c;
	}
	cout << "]" << endl;
}

void rec(int u, int p) {
  D[u] = p;
  if(T[u].r != NIL) rec(T[u].r,p);
  if(T[u].l != NIL) rec(T[u].l,p+1);
}

int main(void) {
  int i,j,d,v,c,l,r;
  cin >> n;
  for(i=0;i<n;i++) T[i].p = T[i].l = T[i].r = NIL;
  for(i=0;i<n;i++) {
    cin >> v >> d;
    for(j=0;j<d;j++) {
      cin >> c;
      if(j==0) T[v].l=c;
      else T[l].r =c;
      l = c;
      T[c].p = v;
    }
  }
  for(i=0;i<n;i++) {
    if(T[i].p == NIL) r = i;
  }
  
  rec(r,0);
  
  for(i=0;i<n;i++) print(i);
  
  return 0;
}


Compiler output:
a.cc:6:21: error: expected ';' at end of member declaration
    6 | struct Node { int p,l.r;}
      |                     ^
      |                      ;
a.cc:6:22: error: expected unqualified-id before '.' token
    6 | struct Node { int p,l.r;}
      |                      ^
a.cc:7:7: error: expected initializer before 'T'
    7 |  Node T[MAX];
      |       ^
a.cc:8:11: error: 'Max' was not declared in this scope; did you mean 'MAX'?
    8 |  int n ,D[Max];
      |           ^~~
      |           MAX
a.cc: In function 'void print(int)':
a.cc:12:9: error: 'count' was not declared in this scope
   12 |         count << "node "<<u<<": ";
      |         ^~~~~
a.cc:13:32: error: 'T' was not declared in this scope
   13 |         count << "parent = " <<T[u].p << ", ";
      |                                ^
a.cc:14:32: error: 'D' was not declared in this scope
   14 |         count << "depth = " << D[u] << "leaf, ";
      |                                ^
a.cc:15:9: error: 'else' without a previous 'if'
   15 |         else if ( T[u].l == NIL) cout << "leaf, ";
      |         ^~~~
a.cc:20:41: error: expected primary-expression before ',' token
   20 |         for (i=0, c = T[u].l;c != NIL;++, c = T[c].r){
      |                                         ^
a.cc: In function 'void rec(int, int)':
a.cc:28:3: error: 'D' was not declared in this scope
   28 |   D[u] = p;
      |   ^
a.cc:29:6: error: 'T' was not declared in this scope
   29 |   if(T[u].r != NIL) rec(T[u].r,p);
      |      ^
a.cc:30:6: error: 'T' was not declared in this scope
   30 |   if(T[u].l != NIL) rec(T[u].l,p+1);
      |      ^
a.cc: In function 'int main()':
a.cc:36:20: error: 'T' was not declared in this scope
   36 |   for(i=0;i<n;i++) T[i].p = T[i].l = T[i].r = NIL;
      |                    ^
a.cc:41:16: error: 'T' was not declared in this scope
   41 |       if(j==0) T[v].l=c;
      |                ^
a.cc:42:12: error: 'T' was not declared in this scope
   42 |       else T[l].r =c;
      |            ^
a.cc:44:7: error: 'T' was not declared in this scope
   44 |       T[c].p = v;
      |       ^
a.cc:48:8: error: 'T' was not declared in this scope
   48 |     if(T[i].p == NIL) r = i;
      |        ^