Language: C++

import java.util.Scanner;

class Main{
	public static void main(String args[]){
		//(new Main()).universe();
		Scanner scanner = new Scanner(System.in);

		try{
			String str = new String();
			while((str = scanner.next()) != null){
				int n = Integer.parseInt(str);
				if(n == 0) return;

				//hashMap = new HashMap<Integer, Integer>();
				//System.out.println(scanA(n));

				for(int i = 0; i < n; i++){
					scanner.next();
				}

			}
		}catch(Exception e){
			System.err.println(e);
		}
	}

	//HashMap<Integer, Integer> hashMap;

	void universe(){
		Scanner scanner = new Scanner(System.in);

		try{
			String str = new String();
			while((str = scanner.next()) != null){
				int n = Integer.parseInt(str);
				if(n == 0) return;

				//hashMap = new HashMap<Integer, Integer>();
				//System.out.println(scanA(n));

				for(int i = 0; i < n; i++){
					scanner.next();
				}

			}
		}catch(Exception e){
			System.err.println(e);
		}
	}

	/*
	String scanA(int n){
		Scanner scanner = new Scanner(System.in);
		for(int i = 0; i < n; i++){
			Integer input_int = scanner.nextInt();

			Integer map_value = hashMap.get(input_int);
			if(map_value != null){
				map_value++;
				if(map_value > n/2) return "" + input_int;
				hashMap.put(input_int,  map_value);
			}else{
				hashMap.put(input_int, 1);
			}
		}
		return "NO COLOR";
	}
	*/
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String args[]){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String args[]){
      |                                 ^~~~~~
a.cc:69:2: error: expected ';' after class definition
   69 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:17: error: 'Scanner' was not declared in this scope
    6 |                 Scanner scanner = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:9:25: error: 'String' was not declared in this scope
    9 |                         String str = new String();
      |                         ^~~~~~
a.cc:10:32: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |                         while((str = scanner.next()) != null){
      |                                ^~~
      |                                std
a.cc:10:38: error: 'scanner' was not declared in this scope
   10 |                         while((str = scanner.next()) != null){
      |                                      ^~~~~~~
a.cc:10:57: error: 'null' was not declared in this scope
   10 |                         while((str = scanner.next()) != null){
      |                                                         ^~~~
a.cc:11:41: error: 'Integer' was not declared in this scope
   11 |                                 int n = Integer.parseInt(str);
      |                                         ^~~~~~~
a.cc:22:24: error: 'Exception' does not name a type
   22 |                 }catch(Exception e){
      |                        ^~~~~~~~~
a.cc:23:25: error: 'System' was not declared in this scope
   23 |                         System.err.println(e);
      |                         ^~~~~~
a.cc:23:44: error: 'e' was not declared in this scope
   23 |                         System.err.println(e);
      |                                            ^
a.cc: In member function 'void Main::universe()':
a.cc:30:17: error: 'Scanner' was not declared in this scope
   30 |                 Scanner scanner = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:33:25: error: 'String' was not declared in this scope
   33 |                         String str = new String();
      |                         ^~~~~~
a.cc:34:32: error: 'str' was not declared in this scope; did you mean 'std'?
   34 |                         while((str = scanner.next()) != null){
      |                                ^~~
      |                                std
a.cc:34:38: error: 'scanner' was not declared in this scope
   34 |                         while((str = scanner.next()) != null){
      |                                      ^~~~~~~
a.cc:34:57: error: 'null' was not declared in this scope
   34 |                         while((str = scanner.next()) != null){
      |                                                         ^~~~
a.cc:35:41: error: 'Integer' was not declared in this scope
   35 |                                 int n = Integer.parseInt(str);
      |                                         ^~~~~~~
a.cc:46:24: error: 'Exception' does not name a type
   46 |                 }catch(Exception e){
      |                        ^~~~~~~~~
a.cc:47:25: error: 'System' was not declared in this scope
   47 |                         System.err.println(e);
      |                         ^~~~~~
a.cc:47:44: error: 'e' was not declared in this scope
   47 |                         System.err.println(e);
      |                                            ^