Language: C++

import java.util.Scanner;

class Main {
    private static boolean[] calcPrimeTable(int n) {
        boolean[] table = new boolean[n + 1];
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (!table[i]) {
                for (int j = i + i; j <= n; j += i) {
                    table[j] = true;
                }
            }
        }
        return table;
    }

    private static void solve() {
        boolean[] table = calcPrimeTable(50000);
        Scanner scanner = new Scanner(System.in);
        while (true) {
            int n = scanner.nextInt();
            int counter = 0;
            if (n == 0) {
                break;
            }
            for (int i = 2; i <= n / 2; i++) {
                if (!table[i] && !table[n - i]) {
                    counter++;
                }
            }
            System.out.println(counter);
        }
    }

    public static void main(String... args) {
        solve();
    }
}

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:12: error: expected ':' before 'static'
    4 |     private static boolean[] calcPrimeTable(int n) {
      |            ^~~~~~~
      |            :
a.cc:4:20: error: 'boolean' does not name a type; did you mean 'bool'?
    4 |     private static boolean[] calcPrimeTable(int n) {
      |                    ^~~~~~~
      |                    bool
a.cc:16:12: error: expected ':' before 'static'
   16 |     private static void solve() {
      |            ^~~~~~~
      |            :
a.cc:34:11: error: expected ':' before 'static'
   34 |     public static void main(String... args) {
      |           ^~~~~~~
      |           :
a.cc:34:29: error: 'String' has not been declared
   34 |     public static void main(String... args) {
      |                             ^~~~~~
a.cc:34:39: error: expansion pattern 'int' contains no parameter packs
   34 |     public static void main(String... args) {
      |                                       ^~~~
a.cc:37:2: error: expected ';' after class definition
   37 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::solve()':
a.cc:17:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   17 |         boolean[] table = calcPrimeTable(50000);
      |         ^~~~~~~
      |         bool
a.cc:17:17: error: expected primary-expression before ']' token
   17 |         boolean[] table = calcPrimeTable(50000);
      |                 ^
a.cc:18:9: error: 'Scanner' was not declared in this scope
   18 |         Scanner scanner = new Scanner(System.in);
      |         ^~~~~~~
a.cc:20:21: error: 'scanner' was not declared in this scope
   20 |             int n = scanner.nextInt();
      |                     ^~~~~~~
a.cc:26:22: error: 'table' was not declared in this scope; did you mean 'mutable'?
   26 |                 if (!table[i] && !table[n - i]) {
      |                      ^~~~~
      |                      mutable
a.cc:30:13: error: 'System' was not declared in this scope
   30 |             System.out.println(counter);
      |             ^~~~~~