Language: C++

import java.util.Arrays;
import java.util.Scanner;

class Hoge {
	private static void print(String s) { System.out.print(s);}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int num_primes = 0;

		initTable();

		for(int i=0;i<N;i++) {
			int x = sc.nextInt();
			if(primeTable[x]) num_primes++;
			updatePrimeTable(x);
		}
		print(num_primes+"\n");
	}
	static boolean[] primeTable = new boolean[10001];
	public static void initTable() {
		Arrays.fill(primeTable, true);
		primeTable[0]=false;
		primeTable[1]=false;
	}

	public static void updatePrimeTable(int x) {
		if(!primeTable[x]) return;
		for(int i=x; i<primeTable.length; i+=x) {
			primeTable[i] = false;
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:16: error: expected ':' before 'static'
    5 |         private static void print(String s) { System.out.print(s);}
      |                ^~~~~~~
      |                :
a.cc:5:35: error: 'String' has not been declared
    5 |         private static void print(String s) { System.out.print(s);}
      |                                   ^~~~~~
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main(String[] args) {
      |               ^~~~~~~
      |               :
a.cc:6:33: error: 'String' has not been declared
    6 |         public static void main(String[] args) {
      |                                 ^~~~~~
a.cc:6:42: error: expected ',' or '...' before 'args'
    6 |         public static void main(String[] args) {
      |                                          ^~~~
a.cc:20:16: error: 'boolean' does not name a type; did you mean 'bool'?
   20 |         static boolean[] primeTable = new boolean[10001];
      |                ^~~~~~~
      |                bool
a.cc:21:15: error: expected ':' before 'static'
   21 |         public static void initTable() {
      |               ^~~~~~~
      |               :
a.cc:27:15: error: expected ':' before 'static'
   27 |         public static void updatePrimeTable(int x) {
      |               ^~~~~~~
      |               :
a.cc:33:2: error: expected ';' after class definition
   33 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Hoge::print(int)':
a.cc:5:47: error: 'System' was not declared in this scope
    5 |         private static void print(String s) { System.out.print(s);}
      |                                               ^~~~~~
a.cc: In static member function 'static void Hoge::main(int*)':
a.cc:7:17: error: 'Scanner' was not declared in this scope
    7 |                 Scanner sc = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:8:25: error: 'sc' was not declared in this scope
    8 |                 int N = sc.nextInt();
      |                         ^~
a.cc:15:28: error: 'primeTable' was not declared in this scope
   15 |                         if(primeTable[x]) num_primes++;
      |                            ^~~~~~~~~~
a.cc:18:33: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   18 |                 print(num_primes+"\n");
      |                       ~~~~~~~~~~^~~~~
      |                                 |
      |                                 const char*
a.cc:5:42: note:   initializing argument 1 of 'static void Hoge::print(int)'
    5 |         private static void print(String s) { System.out.print(s);}
      |                                   ~~~~~~~^
a.cc: In static member function 'static void Hoge::initTable()':
a.cc:22:17: error: 'Arrays' was not declared in this scope
   22 |                 Arrays.fill(primeTable, true);
      |                 ^~~~~~
a.cc:22:29: error: 'primeTable' was not declared in this scope
   22 |                 Arrays.fill(primeTable, true);
      |                             ^~~~~~~~~~
a.cc: In static member function 'static void Hoge::updatePrimeTable(int)':
a.cc:28:21: error: 'primeTable' was not declared in this scope
   28 |                 if(!primeTable[x]) return;
      |                     ^~~~~~~~~~
a.cc:29:32: error: 'primeTable' was not declared in this scope
   29 |                 for(int i=x; i<primeTable.length; i+=x) {
      |                                ^~~~~~~~~~