Language: C++

#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node{
	int key;
	Node *right,*left,*parent;
}:

Node *root,*NIL;

void insert(int k){
	Node *y = NIL;
	Node *x = root;
	Node *z;
	
	z=(Node *)malloc(sizeof(Node));
	z->key=k;
	z->left=NiL;
	z->right=NIL;
	
	while(x!=NIL){
		y=x;
		if(z->key<x->key){
			x=-left+
		}else{
			x=x^>right;
		}
	}
	
	z->parent=y;
	if(y==NIL){
		root=z;
	}else{
		if(z->key<y->key){
			y->left=z;
		}else{
			y->right=z;
		}
	}
}

void inorder(Node *u){
	if(u==NIL)return;
	inoder(u->left);
	printf("%d",u->key);
	inopder(u->right);
}
void preorder(Node *u){
	if(U==NIL)return;
	printf("%d",u->key);
	preorder(u->left);
	preorder(u->right);
}

int main(){
	int n,i,x;
	string com;
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		cin>>com;
		if(com=="insert"){
			scanf("%d",&x);
			insert(x);
		}else if(com=="print"){
			inoder(root);
			printf("\n");
			preoder(root);
			printf("\n");
		}
	}
	return 0;
}


Compiler output:
a.cc:10:2: error: expected ';' after struct definition
   10 | }:
      |  ^
      |  ;
a.cc:10:2: error: expected unqualified-id before ':' token
a.cc: In function 'void insert(int)':
a.cc:15:19: error: 'NIL' was not declared in this scope
   15 |         Node *y = NIL;
      |                   ^~~
a.cc:16:19: error: 'root' was not declared in this scope
   16 |         Node *x = root;
      |                   ^~~~
a.cc:21:17: error: 'NiL' was not declared in this scope
   21 |         z->left=NiL;
      |                 ^~~
a.cc:27:28: error: wrong type argument to unary minus
   27 |                         x=-left+
      |                            ^~~~
a.cc:28:17: error: expected primary-expression before '}' token
   28 |                 }else{
      |                 ^
a.cc:29:29: error: expected primary-expression before '>' token
   29 |                         x=x^>right;
      |                             ^
a.cc: In function 'void inorder(Node*)':
a.cc:46:15: error: 'NIL' was not declared in this scope
   46 |         if(u==NIL)return;
      |               ^~~
a.cc:47:9: error: 'inoder' was not declared in this scope; did you mean 'inorder'?
   47 |         inoder(u->left);
      |         ^~~~~~
      |         inorder
a.cc:49:9: error: 'inopder' was not declared in this scope; did you mean 'inorder'?
   49 |         inopder(u->right);
      |         ^~~~~~~
      |         inorder
a.cc: In function 'void preorder(Node*)':
a.cc:52:12: error: 'U' was not declared in this scope
   52 |         if(U==NIL)return;
      |            ^
a.cc:52:15: error: 'NIL' was not declared in this scope
   52 |         if(U==NIL)return;
      |               ^~~
a.cc: In function 'int main()':
a.cc:70:32: error: 'root' was not declared in this scope
   70 |                         inoder(root);
      |                                ^~~~
a.cc:70:25: error: 'inoder' was not declared in this scope; did you mean 'inorder'?
   70 |                         inoder(root);
      |                         ^~~~~~
      |                         inorder
a.cc:72:25: error: 'preoder' was not declared in this scope; did you mean 'preorder'?
   72 |                         preoder(root);
      |                         ^~~~~~~
      |                         preorder