Language: C++

import java.util.*;

class Main {

	public static boolean search(int[] A, int n, int key) {
		A[n] = key;
		int i = 0;
		while(A[i] != key)i++;
		return i != n;
	}
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[10001];
		int[] arrayT = new int[501];
		int count = 0;
		int sNum = scan.nextInt();

		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		int tNum = scan.nextInt();
		
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		
		for (int j = 0; j < tNum; j++)
			if(search(arrayS, sNum, arrayT[j])) count++;

		System.out.println(count);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static boolean search(int[] A, int n, int key) {
      |               ^~~~~~~
      |               :
a.cc:5:23: error: 'boolean' does not name a type; did you mean 'bool'?
    5 |         public static boolean search(int[] A, int n, int key) {
      |                       ^~~~~~~
      |                       bool
a.cc:11:15: error: expected ':' before 'static'
   11 |         public static void main(String args[]) {
      |               ^~~~~~~
      |               :
a.cc:11:33: error: 'String' has not been declared
   11 |         public static void main(String args[]) {
      |                                 ^~~~~~
a.cc:32:2: error: expected ';' after class definition
   32 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:12:17: error: 'Scanner' was not declared in this scope
   12 |                 Scanner scan = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:13:20: error: structured binding declaration cannot have type 'int'
   13 |                 int[] arrayS = new int[10001];
      |                    ^~
a.cc:13:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:13:20: error: empty structured binding declaration
a.cc:13:23: error: expected initializer before 'arrayS'
   13 |                 int[] arrayS = new int[10001];
      |                       ^~~~~~
a.cc:14:20: error: structured binding declaration cannot have type 'int'
   14 |                 int[] arrayT = new int[501];
      |                    ^~
a.cc:14:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:14:20: error: empty structured binding declaration
a.cc:14:23: error: expected initializer before 'arrayT'
   14 |                 int[] arrayT = new int[501];
      |                       ^~~~~~
a.cc:16:28: error: 'scan' was not declared in this scope
   16 |                 int sNum = scan.nextInt();
      |                            ^~~~
a.cc:19:25: error: 'arrayS' was not declared in this scope
   19 |                         arrayS[i] = scan.nextInt();
      |                         ^~~~~~
a.cc:24:25: error: 'arrayT' was not declared in this scope
   24 |                         arrayT[j] = scan.nextInt();
      |                         ^~~~~~
a.cc:28:35: error: 'arrayS' was not declared in this scope
   28 |                         if(search(arrayS, sNum, arrayT[j])) count++;
      |                                   ^~~~~~
a.cc:28:49: error: 'arrayT' was not declared in this scope
   28 |                         if(search(arrayS, sNum, arrayT[j])) count++;
      |                                                 ^~~~~~
a.cc:28:28: error: 'search' was not declared in this scope
   28 |                         if(search(arrayS, sNum, arrayT[j])) count++;
      |                            ^~~~~~
a.cc:30:17: error: 'System' was not declared in this scope
   30 |                 System.out.println(count);
      |                 ^~~~~~