Language: C++

#include<iostream>
using namespase 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;
	cout << "node" << u <<": ";
	cout << "parent= " << T[u].p << ", ";
	out << "depth= " << D[u] << ", ";

	if (T[u].p == NIL)
	{
		cout << "root, ";
	}
	else if (T[u].l == NIL)
	{
		cout << "leaf, ";
	}
	else
	{
		cout << "internal node, ";
	}

	cout << "[";

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

int 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()
{
	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++)
	{
		printf(i);
	}
	return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'void print(int)':
a.cc:17:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |         cout << "node" << u <<": ";
      |         ^~~~
      |         std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:9: error: 'out' was not declared in this scope
   19 |         out << "depth= " << D[u] << ", ";
      |         ^~~
a.cc:36:43: error: expected ')' before ';' token
   36 |         for (int i = 0;c = T[u].l;c != NIL;i++, c =T[c].r)
      |             ~                             ^
a.cc:36:58: error: expected ';' before ')' token
   36 |         for (int i = 0;c = T[u].l;c != NIL;i++, c =T[c].r)
      |                                                          ^
      |                                                          ;
a.cc:41:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   41 |         cout << "]" << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'int rec(int, int)':
a.cc:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
   49 | }
      | ^
a.cc: In function 'int main()':
a.cc:54:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   54 |         cin >> n;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:67:33: error: 't' was not declared in this scope
   67 |                                 t[v].l=c;
      |                                 ^
a.cc:86:24: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   86 |                 printf(i);
      |                        ^
      |                        |
      |                        int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~