Language: C++

#include <iostream>
#include <stdio.h>
#include <cstdio>
#include <string>
#include <algorithm>
#include <limits.h>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <iomanip>
#include <math.h>
#include <cmath>

#define NIL -1
struct Node { int parent, left, right, key; };
Node tree[500001];
int treesize;
int root = NIL;
int findlist[100000];

void in(int id)
{
	if (id == NIL) return;
	cout << " " << tree[id].key;
	in(tree[id].left);
	in(tree[id].right);
}

void pre(int id)
{
	if (id == NIL) return;
	pre(tree[id].left);
	cout << " " << tree[id].key;
	pre(tree[id].right);
}

bool find(int id)
{
	if (!treesize) return false;
	else
	{
		for(int i = 0; i < treesize;++i)
		{
			if (tree[i].key == id) return true;
		}
		return false;
	}
}

void insert(int key)
{
	int y = NIL;
	int x = root;
	while (x != NIL)
	{
		y = x;
		if (key < tree[x].key) x = tree[x].left;
		else x = tree[x].right;
	}
	tree[treesize].parent = y;

	if (y == NIL) root = treesize;
	else if (key < tree[y].key) tree[y].left = treesize;
	else tree[y].right = treesize;

	tree[treesize].left = NIL;
	tree[treesize].right = NIL;
	tree[treesize].key = key;

	treesize++;
}

int main(void)
{
	int n;
	string str;
	int value = 0;
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> str;

		if (str == "insert")
		{
			int key;
			cin >> key;
			insert(key);
		}
		else if (str == "find")
		{
			cin >> findlist[value];
			value++;
		}
		else if (str == "print")
		{
			if (findlist != NULL)
			{
				for (int i = 0; i < value; ++i)
				{
					if (find(findlist[i])) cout << "yes" << endl;
					else cout << "no" << endl;
				}
			}
			pre(root);
			cout << endl;
			in(root);
			cout << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'void in(int)':
a.cc:27:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |         cout << " " << tree[id].key;
      |         ^~~~
      |         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: In function 'void pre(int)':
a.cc:36:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   36 |         cout << " " << tree[id].key;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:79:9: error: 'string' was not declared in this scope
   79 |         string str;
      |         ^~~~~~
a.cc:79:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:81:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   81 |         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:85:24: error: 'str' was not declared in this scope; did you mean 'std'?
   85 |                 cin >> str;
      |                        ^~~
      |                        std
a.cc:104:64: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
  104 |                                         if (find(findlist[i])) cout << "yes" << endl;
      |                                                                ^~~~
      |                                                                std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:104:81: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
  104 |                                         if (find(findlist[i])) cout << "yes" << endl;
      |                                                                                 ^~~~
      |                                                                                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:105:46: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
  105 |                                         else cout << "no" << endl;
      |                                              ^~~~
      |                                              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:105:62: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
  105 |                                         else cout << "no" << endl;
      |                                                              ^~~~
      |                                                              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:109:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
  109 |                         cout << endl;
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:109:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
  109 |                         cout << endl;
      |                                 ^~~~
      |                                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~