Language: C++

#include<iostream>
#include<string>
using namespace std;
int a;
struct NodeDiv2 {
????????int key;
????????NodeDiv2 *parent, *left, *right;
};
NodeDiv2 *root, *NIL;
void preTreeWalkDiv2(NodeDiv2 *u){
????????if (u == NIL) { return; }
????????cout << ' ' << u->key;
????????preTreeWalkDiv2(u->left);
????????preTreeWalkDiv2(u->right);
}
void inTreeWalkDiv2(NodeDiv2 *u) {
????????if (u == NIL) { return; }
????????inTreeWalkDiv2(u->left);
????????cout << ' ' << u->key;
????????inTreeWalkDiv2(u->right);
}
void insertDiv2(int k) {
????????NodeDiv2 *y = NIL;
????????NodeDiv2 *x = root;
????????NodeDiv2 *z;
????????z = (NodeDiv2*)malloc(sizeof(NodeDiv2));
????????z->key = k;
????????z->right = NIL;
????????z->left = NIL;
????????while (x != NIL) {
????????????????y = x;
????????????????if (z->key < x->key) { x = 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; }
}
int q;
string S;
int main() {
????????cin >> q;
????????for (int i = 0; i < q; i++) {
????????????????cin >> S;
????????????????if (S == "print") {
????????????????????????inTreeWalkDiv2(root); cout << endl;
????????????????????????preTreeWalkDiv2(root); cout << endl;
????????????????}
????????????????else {
????????????????????????cin >> a;
????????????????????????insertDiv2(a);
????????????????}
????????}
????????return 0;
}

Compiler output:
a.cc:6:1: error: expected unqualified-id before '?' token
    6 | ????????int key;
      | ^
a.cc:7:1: error: expected unqualified-id before '?' token
    7 | ????????NodeDiv2 *parent, *left, *right;
      | ^
a.cc: In function 'void preTreeWalkDiv2(NodeDiv2*)':
a.cc:11:1: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      | ^
a.cc:11:2: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |  ^
a.cc:11:3: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |   ^
a.cc:11:4: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |    ^
a.cc:11:5: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |     ^
a.cc:11:6: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |      ^
a.cc:11:7: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |       ^
a.cc:11:8: error: expected primary-expression before '?' token
   11 | ????????if (u == NIL) { return; }
      |        ^
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:11:9: error: expected ':' before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
      |         :
a.cc:11:9: error: expected primary-expression before 'if'
   11 | ????????if (u == NIL) { return; }
      |         ^~
a.cc:12:1: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      | ^
a.cc:12:2: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |  ^
a.cc:12:3: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |   ^
a.cc:12:4: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |    ^
a.cc:12:5: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |     ^
a.cc:12:6: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |      ^
a.cc:12:7: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |       ^
a.cc:12:8: error: expected primary-expression before '?' token
   12 | ????????cout << ' ' << u->key;
      |        ^
a.cc:12:27: error: 'struct NodeDiv2' has no member named 'key'
   12 | ????????cout << ' ' << u->key;
      |                           ^~~
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:12:30: error: expected ':' before ';' token
   12 | ????????cout << ' ' << u->key;
      |                              ^
      |                              :
a.cc:12:30: error: expected primary-expression before ';' token
a.cc:13:1: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      | ^
a.cc:13:2: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |  ^
a.cc:13:3: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |   ^
a.cc:13:4: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |    ^
a.cc:13:5: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |     ^
a.cc:13:6: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |      ^
a.cc:13:7: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |       ^
a.cc:13:8: error: expected primary-expression before '?' token
   13 | ????????preTreeWalkDiv2(u->left);
      |        ^
a.cc:13:28: error: 'struct NodeDiv2' has no member named 'left'
   13 | ????????preTreeWalkDiv2(u->left);
      |                            ^~~~
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:13:33: error: expected ':' before ';' token
   13 | ????????preTreeWalkDiv2(u->left);
      |                                 ^
      |                                 :
a.cc:13:33: error: expected primary-expression before ';' token
a.cc:14:1: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      | ^
a.cc:14:2: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |  ^
a.cc:14:3: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |   ^
a.cc:14:4: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |    ^
a.cc:14:5: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |     ^
a.cc:14:6: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |      ^
a.cc:14:7: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |       ^
a.cc:14:8: error: expected primary-expression before '?' token
   14 | ????????preTreeWalkDiv2(u->right);
      |        ^
a.cc:14:28: error: 'struct NodeDiv2' has no member named 'right'
   14 | ????????preTreeWalkDiv2(u->right);
      |