criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define all(a) (a).begin(), (a).end()

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

/*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/
const int MAX = 1000100;
bool prime[MAX];

void sieve(){
    fill(prime, prime+MAX, true);
    prime[0] = prime[1] = false;

    for(int i=2; i*i < MAX; i++){
	        if(!prime[i]) continue;
	        for(int j=i*i; j < MAX; j += i) prime[j] = false;
	    }
}


int main(){
	sieve();
	int n;
	while(cin >> n, n){
		int ret = 0;
		for(int i=0; i< n; i++){
			for(int j=i; j < n; j++) if(prime[i] && prime[j] && i+j == n) ret++;
		}
		cout << ret << endl;
	}
}

Compiler output:
a.cc:14:1: error: unterminated comment
   14 | /*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/
      | ^
Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args){
		Main myMain = new Main();
		BufferedReader reader =
				new BufferedReader(new InputStreamReader(System.in));
		
		int n,slot,count;
		boolean is;
		
		try{
			while((n = Integer.parseInt(reader.readLine())) != 0){
				int[] x = new int[n];
				slot = count = 0;
				
				for(int i = 2; i < n; i++){
					is = true;
					is = myMain.prime(i,is);
					if(is){
						x[slot++] = i;
					}
				}
				
				for(int i = 0; i < x.length; i++){
					for(int j = i; j < x.length; j++){
						if(x[i] + x[j] == n){
							count++;
						}
					}
				}
				System.out.println(count);	
			}
			reader.close();
		}catch(IOException e){
		}
	}
	
	public boolean prime(int x, boolean y){
		
		for(int i = 2; i <= Math.sqrt(x); i++){
			if(x % i == 0){
				y = false;
				break;
			}
		}
		return y;
	}
	
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
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.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main{
      | ^~~~~~
Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args){
		Main myMain = new Main();
		BufferedReader reader =
				new BufferedReader(new InputStreamReader(System.in));
		
		int n,slot,count;
		boolean is;
		int[] x = new int[50001];
		
		try{
			while((n = Integer.parseInt(reader.readLine())) != 0){
				slot = count = 0;
				
				for(int i = 2; i < n; i++){
					is = true;
					is = myMain.prime(i,is);
					if(is){
						x[slot++] = i;
					}
				}
				
				for(int i = 0; i < n / 2; i++){
					for(int j = i; j < n / 2; j++){
						if(x[i] + x[j] == n){
							count++;
						}
					}
				}
				System.out.println(count);	
			}
			reader.close();
		}catch(IOException e){
		}
	}
	
	public boolean prime(int x, boolean y){
		
		for(int i = 2; i <= Math.sqrt(x); i++){
			if(x % i == 0){
				y = false;
				break;
			}
		}
		return y;
	}
	
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
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.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main{
      | ^~~~~~
Language: C++

#! ruby -n
require 'prime'
n=$_.to_i;a=Prime.each(50000).to_a;
n>0&&p([*2..(n+1)/2].count{|v|a.index(v)&&a.index(n-v)})

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #! ruby -n
      |  ^
a.cc:2:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    2 | require 'prime'
      |         ^~~~~~~
a.cc:4:10: error: too many decimal points in number
    4 | n>0&&p([*2..(n+1)/2].count{|v|a.index(v)&&a.index(n-v)})
      |          ^~~
a.cc:2:1: error: 'require' does not name a type
    2 | require 'prime'
      | ^~~~~~~
a.cc:3:11: error: 'a' does not name a type
    3 | n=$_.to_i;a=Prime.each(50000).to_a;
      |           ^
a.cc:4:1: error: 'n' does not name a type
    4 | n>0&&p([*2..(n+1)/2].count{|v|a.index(v)&&a.index(n-v)})
      | ^
a.cc:4:56: error: expected unqualified-id before ')' token
    4 | n>0&&p([*2..(n+1)/2].count{|v|a.index(v)&&a.index(n-v)})
      |                                                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int  prime[50001];
    for(int i=2;i<50001;i++)prime[i]=0;
    for(int i=2;i<=sqrt(50001);i++){
        if(prime[i]==0){
            for(int j=i+i;j<50001;j+=i)prime[j]=1;
        }
    }
    int n,cou=0;
    while(cin>>n&&n!=0){
        if(n%2!=0)cout<<"0"<<endl;
        else{
            if(n==4)cou=1;
            else for(int i=3;i<=n/2;i+=2)if(prime[i]==0&&prime[n-i]==0)cou++;
            cout<<cou<<endl;
            cou=0;
        }
    }
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int  prime[50001];
    for(int i=2;i<50001;i++)prime[i]=0;
    for(int i=2;i<=sqrt(50001);i++){
        if(prime[i]==0){
            for(int j=i+i;j<50001;j+=i)prime[j]=1;
        }
    }
    int n,cou=0;
    while(cin>>n&&n!=0){
        if(n%2!=0)cout<<"0"<<endl;
        else{
            if(n==4)cou=1;
            else for(int i=3;i<=n/2;i+=2)if(prime[i]==0&&prime[n-i]==0)cou++;
            cout<<cou<<endl;
            cou=0;
        }
    }
}

Compiler output:
a.cc:25:5: error: redefinition of 'int main()'
   25 | int main()
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main()
      |     ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
bool prime(int n);

int main() {
    vector<int> array;
    int n;

    array.push_back(2);
    for (int i = 3; i < 50000; i+=2) {
        if (prime(i)) array.push_back(i);
    }//?´???°?????§?????????

    int count;
    while (cin >> n && n) {
        count = 0;
        for (int i = 0; 2 * array.at(i) <= n; i++) {
            if (find(array.begin(), array.end(), n - array.at(i)) != array.end()) {
                count++;
            }
        }
        cout << count << endl;
    }
    return 0;
}

bool prime(int n) {
    for (int i = 3; i <= sqrt(n); i += 2) {
        if (n % i == 0) return false;
    }
    return true;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
   20 |             if (find(array.begin(), array.end(), n - array.at(i)) != array.end()) {
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:20:21: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   20 |             if (find(array.begin(), array.end(), n - array.at(i)) != array.end()) {
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++


#include <iostream>
#include <stdio.h>
using namespace std;


#define MAX_N 50001
bool IsPrime[MAX_N];

void q56() {
	memset(IsPrime, 1, sizeof(IsPrime));
	IsPrime[0] = false;
	IsPrime[1] = false;
	for (int i = 0; i < sqrt(MAX_N); i++) {
		if (!IsPrime[i]) continue;
		for (int j = i * 2; j < MAX_N; j += i) {
			IsPrime[j] = false;
		}
	}
	int n;
	for (; cin >> n;) {
		if (!n) break;
		int cnt = 0;
		for (int i = 0; i < (double)(n+1)/2; i++) {
			if (IsPrime[i] && IsPrime[n - i]) cnt++;
		}
		cout << cnt << endl;
	}
}
int main() {
	q56();
	return 0;
}

Compiler output:
a.cc: In function 'void q56()':
a.cc:11:9: error: 'memset' was not declared in this scope
   11 |         memset(IsPrime, 1, sizeof(IsPrime));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | #include <stdio.h>
a.cc:14:29: error: 'sqrt' was not declared in this scope
   14 |         for (int i = 0; i < sqrt(MAX_N); i++) {
      |                             ^~~~
Language: C++


#include <iostream>
#include <stdio.h>
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>

#define MAX_N 50001
bool IsPrime[MAX_N];

void q56() {
	memset(IsPrime, 1, sizeof(IsPrime));
	IsPrime[0] = false;
	IsPrime[1] = false;
	for (int i = 0; i < sqrt(MAX_N); i++) {
		if (!IsPrime[i]) continue;
		for (int j = i * 2; j < MAX_N; j += i) {
			IsPrime[j] = false;
		}
	}
	int n;
	for (; cin >> n;) {
		if (!n) break;
		int cnt = 0;
		for (int i = 0; i < (double)(n+1)/2; i++) {
			if (IsPrime[i] && IsPrime[n - i]) cnt++;
		}
		cout << cnt << endl;
	}
}
int main() {
	q56();
	return 0;
}

Compiler output:
a.cc: In function 'void q56()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(IsPrime, 1, sizeof(IsPrime));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <math.h>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include<cstdlib>
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>

#define MAX_N 50001
bool IsPrime[MAX_N];

void q56() {
	memset(IsPrime, 1, sizeof(IsPrime));
	IsPrime[0] = false;
	IsPrime[1] = false;
	for (int i = 0; i < sqrt(MAX_N); i++) {
		if (!IsPrime[i]) continue;
		for (int j = i * 2; j < MAX_N; j += i) {
			IsPrime[j] = false;
		}
	}
	int n;
	for (; cin >> n;) {
		if (!n) break;
		int cnt = 0;
		for (int i = 0; i < (double)(n+1)/2; i++) {
			if (IsPrime[i] && IsPrime[n - i]) cnt++;
		}
		cout << cnt << endl;
	}
}
int main() {
	q56();
	return 0;
}

Compiler output:
a.cc: In function 'void q56()':
a.cc:14:9: error: 'memset' was not declared in this scope
   14 |         memset(IsPrime, 1, sizeof(IsPrime));
      |         ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <math.h>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <iostream>
using namespace std;

int main()
{

	bool is_prime[50000];
	
	is_prime[0]=is_prime[1]=false;
	for(int i=2; i<50000; i++){
		is_prime[i]=true;
	}
	
	for(int i=2; i*i<50000; i++){
		if(is_prime[i]){
			for(int j=i*i; j<50000; j+=i){
				is_prime[j]=false;
			}
		}
	}
	
	int prime[5133];
	for(int i=0; i<=5133; i++)
		if(is_prime[i]){
			prime[cnt]=i;
			cnt++;
		}
	while(true){
		int n;
		cin>>n;
		
		if(cin.eof())
			break;
		
		int output=0;
		
		
		for(int i=0; i<n; i++){
			for(int j=i; j<n; j++){
				if((prime[i]+prime[j])==n){
					output++;
				}
			}
		}
		cout<<output<<endl;
	}
}
		

Compiler output:
a.cc: In function 'int main()':
a.cc:25:31: error: 'cnt' was not declared in this scope; did you mean 'int'?
   25 |                         prime[cnt]=i;
      |                               ^~~
      |                               int
Language: C++

#include<iostream>
#include<algorithm>
#include<deque>

using namespace std;

void MakePrimeArray(bool& A[],int n){
	
	A[0] = A[1] = false;
	for(int i=2;i<n;i++){
		A[i] = true;
	}
	
	for(int	i=2;i*i<n;i++){
	if(A[i]){
			for(int j=i*i;j<n;j+=i){
				A[j] = false;
			}
		}
	}
	
}

inline int GoldBach(const deque<int>& prime,int n){
	
	int count=0;
	deque<int> clear;
	bool ok=true;
	
	for(int i=0;prime[i]<n;i++){

		if(std::binary_search(clear.begin(), clear.end(), prime[i])){
			continue;
		}
		
		int num=n-prime[i];
		
	
		if(std::binary_search(prime.begin(), prime.end(), num)){
			count++;	
			clear.insert(clear.begin(),num);
		}
		
	}
	return count;
}

int main(){
	
	int n=50000;

	bool *primearray = new bool[n];
	
	MakePrimeArray(primearray,n);
	
	deque<int> prime;
	
	for(int i=2;i<n;i++){
		if(primearray[i]){
			prime.push_back(i);
		}
	}
	
	
	while(true){
		int innum;
		cin >> innum;
		
		if(innum==0) break;
		
		cout << GoldBach(prime,innum) << endl;
	}
	
	delete[] primearray;
	return 0;
}

Compiler output:
a.cc:7:27: error: declaration of 'A' as array of references
    7 | void MakePrimeArray(bool& A[],int n){
      |                           ^
a.cc:7:30: error: expected ')' before ',' token
    7 | void MakePrimeArray(bool& A[],int n){
      |                    ~         ^
      |                              )
a.cc:7:31: error: expected unqualified-id before 'int'
    7 | void MakePrimeArray(bool& A[],int n){
      |                               ^~~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<deque>

using namespace std;

void MakePrimeArray(deque<bool>& A,int n){
	
	A[0] = A[1] = false;
	for(int i=2;i<n;i++){
		A[i] = true;
	}
	
	for(int	i=2;i*i<n;i++){
	if(A[i]){
			for(int j=i*i;j<n;j+=i){
				A[j] = false;
			}
		}
	}
	
}

inline int GoldBach(const deque<int>& prime,int n){
	
	int count=0;
	deque<int> clear;
	bool ok=true;
	
	for(int i=0;prime[i]<n;i++){

		if(std::binary_search(clear.begin(), clear.end(), prime[i])){
			continue;
		}
		
		int num=n-prime[i];
		
	
		if(std::binary_search(prime.begin(), prime.end(), num)){
			count++;	
			clear.insert(clear.begin(),num);
		}
		
	}
	return count;
}

int main(){
	
	int n=50001;

	deque<bool> primearray;
	
	primearray.resize(n);
	
	MakePrimeArray(primearray,n);
	
	deque<int> prime;
	
	for(int i=2;i<n;i++){
		if(primearray[i]){
			prime.push_back(i);
		}
	}
	
	
	while(true){
		int innum;
		cin >> innum;
		scanf("%d",&innum);
		
		if(innum==0) break;
		int answer = GoldBach(prime,innum) ;
		printf("%d \n",answer);
		cout << GoldBach(prime,innum) << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:17: error: 'cin' was not declared in this scope
   69 |                 cin >> innum;
      |                 ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<deque>
  +++ |+#include <iostream>
    4 | 
a.cc:75:17: error: 'cout' was not declared in this scope
   75 |                 cout << GoldBach(prime,innum) << endl;
      |                 ^~~~
a.cc:75:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:75:50: error: 'endl' was not declared in this scope
   75 |                 cout << GoldBach(prime,innum) << endl;
      |                                                  ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<deque>
  +++ |+#include <ostream>
    4 |
Language: C++

#include<iostream>
using namespace std;

int main(){

	bool is_prime[50000];
	
	is_prime[0]=is_prime[1]=false;
	for(int i=2;i<50000;i++){
		is_prime[i]=true;
	}
	
	for(int i=2;i*i<50000;i++){
		if(is_prime[i]){
			for(int j=i*i;j<50000;j+=i){
				is_prime[j]=false;
			}
		}
	}
	
	
	while(true){
		int n;
		cin>>n;
		int count=0;
		
		if(cin.eof())
			break;
		
		for(int i=0;i<=(n/2);i++){
			if(is_prime[i]&&is_prime[n-i]){
				if(
					count++;
			}
		}
		
		cout<<count<<endl;
		}
	
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:25: error: expected primary-expression before '}' token
   34 |                         }
      |                         ^
a.cc:33:49: error: expected ')' before '}' token
   33 |                                         count++;
      |                                                 ^
      |                                                 )
   34 |                         }
      |                         ~                        
a.cc:32:35: note: to match this '('
   32 |                                 if(
      |                                   ^
a.cc:34:25: error: expected primary-expression before '}' token
   34 |                         }
      |                         ^
Language: C++

#include<iostream>
using namespace std;

int main(){

	bool is_prime[50000];
	
	is_prime[0]=is_prime[1]=false;
	for(int i=2;i<50000;i++){
		is_prime[i]=true;
	}
	
	for(int i=2;i*i<50000;i++){
		if(is_prime[i]){
			for(int j=i*i;j<50000;j+=i){
				is_prime[j]=false;
			}
		}
	}
	
	
	while(true){
		int n;
		cin>>n;
		int count=0;
		
		if(n==0)
			break;
		
		for(int i=2;i<=(n/2);i++){
			if(is_prime[i]&&is_prime[n-i]){
				if(
					count++;
			}
		}
		
		cout<<count<<endl;
		}
	
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:25: error: expected primary-expression before '}' token
   34 |                         }
      |                         ^
a.cc:33:49: error: expected ')' before '}' token
   33 |                                         count++;
      |                                                 ^
      |                                                 )
   34 |                         }
      |                         ~                        
a.cc:32:35: note: to match this '('
   32 |                                 if(
      |                                   ^
a.cc:34:25: error: expected primary-expression before '}' token
   34 |                         }
      |                         ^
Language: C++

import Control.Monad
import Control.Monad.State
import Data.List (foldl')

main = evalStateT solve primes

solve :: StateT [Int] IO ()
solve = do
  ps <- get
  n <- liftIO readLn
  unless (n == 0) $ do
    liftIO . print $ primeComsLen n 0 ps
    solve

primeComs n = [ (i,j) | i <- takeWhile (\x -> 2*x <= n) $ primes,j <- [n-i], isPrime j]
primes :: [Int]
primes = 2 : filter isPrime [3,5..50001]
isPrime :: Int -> Bool
isPrime n = foldl' (flip $ (&&).(/= 0).mod n) True $ takeWhile (<=sqrtn) primes
  where sqrtn = floor.sqrt.fromIntegral $ n

primeComsLen n l (x:xs)
  | 2*x > n       = l
  | isPrime (n-x) = primeComsLen n (l+1) xs
  | otherwise     = primeComsLen n l xs

Compiler output:
a.cc:3:24: warning: missing terminating ' character
    3 | import Data.List (foldl')
      |                        ^
a.cc:3:24: error: missing terminating ' character
    3 | import Data.List (foldl')
      |                        ^~
a.cc:15:41: error: stray '\' in program
   15 | primeComs n = [ (i,j) | i <- takeWhile (\x -> 2*x <= n) $ primes,j <- [n-i], isPrime j]
      |                                         ^
a.cc:17:32: error: too many decimal points in number
   17 | primes = 2 : filter isPrime [3,5..50001]
      |                                ^~~~~~~~
a.cc:19:18: warning: missing terminating ' character
   19 | isPrime n = foldl' (flip $ (&&).(/= 0).mod n) True $ takeWhile (<=sqrtn) primes
      |                  ^
a.cc:19:18: error: missing terminating ' character
   19 | isPrime n = foldl' (flip $ (&&).(/= 0).mod n) True $ takeWhile (<=sqrtn) primes
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Monad
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;

int main(){
  bool is_prime[50000];

  is_prime[0] = is_prime[1] = false;
  for(int i=2; i<50000; i++){
    is_prime[i] = true;
  }

  for(int i=2; i*i<50000; i++){
    if(is_prime[i]){
      for(int j=i*i; j<50000; j+=i){
	is_prime[j] = false;
      }
    }
  }

  while(true){
    int n;
    cin >> n;

    if(n==0)
      break;
#include<iostream>
using namespace std;

int main(){
  bool is_prime[100000];

  is_prime[0] = is_prime[1] = false;
  for(int i=2; i<100000; i++){
    is_prime[i] = true;
  }

  for(int i=2; i*i<100000; i++){
    if(is_prime[i]){
      for(int j=i*i; j<100000; j+=i){
	is_prime[j] = false;
      }
    }
  }
    if(n%2==0){
      int cnt = 0;
      for(int i=3; i<=n/2; i=i+2){
	if(is_prime[i] && is_prime[n-i]){
	  cnt++;
	}
      }

      cout << cnt <<endl;
    }
    else{
      cout << 0 << endl;
    }
  }

  return 0;
}

    



Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   29 | int main(){
      |         ^~
a.cc:29:9: note: remove parentheses to default-initialize a variable
   29 | int main(){
      |         ^~
      |         --
a.cc:29:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:29:11: error: a function-definition is not allowed here before '{' token
   29 | int main(){
      |           ^
a.cc:60:2: error: expected '}' at end of input
   60 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<math.h>
using namespace std;

int cnt;

int main(){
  bool is_prime[50001];
  is_prime[0]=false;is_prime[1]=false;
  for(int i=2;i<50001;i++)is_prime[i]=true;
  for(int i=2;i<=sqrt(50001);i++){
    if(is_prime[i]){
      for(int j=2;i*j<=50001;j++)is_prime[i*j]=false;
    }
  }


  int n;
  while(1){#include<iostream>
#include<math.h>
using namespace std;

int cnt;

int main(){
  bool is_prime[50001];
  is_prime[0]=false;is_prime[1]=false;
  for(int i=2;i<50001;i++)is_prime[i]=true;
  for(int i=2;i<=sqrt(50001);i++){
    if(is_prime[i]){
      for(int j=2;i*j<=50001;j++)is_prime[i*j]=false;
    }
  }


  int n;
  while(1){
    cin>>n;
    if(n==0)break;
    cnt=0;

    for(int i=2;i<=n/2;i++){
      if(is_prime[i]){
        if(is_prime[n-i])cnt++;
      }
    }
    cout<<cnt<<endl;
  }
}

    cin>>n;
    if(n==0)break;
    cnt=0;

    for(int i=2;i<=n/2;i++){
      if(is_prime[i]){
        if(is_prime[n-i])cnt++;
      }
    }
    cout<<cnt<<endl;
  }
}



Compiler output:
a.cc:19:12: error: stray '#' in program
   19 |   while(1){#include<iostream>
      |            ^
a.cc: In function 'int main()':
a.cc:19:13: error: 'include' was not declared in this scope
   19 |   while(1){#include<iostream>
      |             ^~~~~~~
a.cc:19:29: error: expected primary-expression before '>' token
   19 |   while(1){#include<iostream>
      |                             ^
a.cc:21:1: error: expected primary-expression before 'using'
   21 | using namespace std;
      | ^~~~~
a.cc:25:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   25 | int main(){
      |         ^~
a.cc:25:9: note: remove parentheses to default-initialize a variable
   25 | int main(){
      |         ^~
      |         --
a.cc:25:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:25:11: error: a function-definition is not allowed here before '{' token
   25 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  bool a[50000];

  a[0]=a[1]=false;
  for(int i=2;i<50000;i++){
    a[i]=true;
  }

  for(int i=2;i*i<50000;i++){
    if(a[i]){
      for(int j=i*i;j<50000;j+=i){
        a[j]=false;
      }
    }
  }

  int count=0;

  while(true){
    int m;
    cin>>m;
    if(m%2==1){
      continue;
    }

    if(m==0){
      break;
    }

    for(int i=2;i<=m/2;i++){
      if(a[i]){
        if(a[m-i]){
          count++;
        }
    }

    cout<<count<<endl;

  }

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++


/*----------------------h28i13 織海斗------------------------*/#include <iostream>using namespace std; int main(){    bool is_prime[1000000];    is_prime[0]=is_prime[1]=false;    for(int i=2;i<1000000;i++){        is_prime[i]=true;    }    for(int i=2;i*i<1000000;i++){        if(is_prime[i]){            for(int j=i*i;j<1000000;j+=i){                is_prime[j]=false;            }        }    }     int n[10000],num[10000];    int j=0;    for(int i=0;i<10000;i++){        num[i]=0;    }    while(true){        cin>>n[j];        if(n[j]==0)            break;        for(int i=2;i<n[j]/2+1;i++){


Compiler output:
a.cc:2:89: warning: extra tokens at end of #include directive
    2 | /*----------------------h28i13 織海斗------------------------*/#include <iostream>using namespace std; int main(){    bool is_prime[1000000];    is_prime[0]=is_prime[1]=false;    for(int i=2;i<1000000;i++){        is_prime[i]=true;    }    for(int i=2;i*i<1000000;i++){        if(is_prime[i]){            for(int j=i*i;j<1000000;j+=i){                is_prime[j]=false;            }        }    }     int n[10000],num[10000];    int j=0;    for(int i=0;i<10000;i++){        num[i]=0;    }    while(true){        cin>>n[j];        if(n[j]==0)            break;        for(int i=2;i<n[j]/2+1;i++){
      |                                                                                         ^~~~~~~~~
a.cc:2:73: fatal error: iostream>usin: No such file or directory
    2 | /*----------------------h28i13 織海斗------------------------*/#include <iostream>using namespace std; int main(){    bool is_prime[1000000];    is_prime[0]=is_prime[1]=false;    for(int i=2;i<1000000;i++){        is_prime[i]=true;    }    for(int i=2;i*i<1000000;i++){        if(is_prime[i]){            for(int j=i*i;j<1000000;j+=i){                is_prime[j]=false;            }        }    }     int n[10000],num[10000];    int j=0;    for(int i=0;i<10000;i++){        num[i]=0;    }    while(true){        cin>>n[j];        if(n[j]==0)            break;        for(int i=2;i<n[j]/2+1;i++){
      |                                                                         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

int main(){
  bool prime[50000];
  prime[0]=prime[1]=false;
  for(int i=2;i<50000;i++){
    prime[i]=true;
  }

  for(int i=2;i*i<50000;i++){
    if(prime[i]){
      for(int j=i*i;j<50000; j+=i){
        prime[j]=false;
      }
    }
  }

  while(true){
    int min,a,cnt;
    cin >> a;

    if(a==0)
      break;

      if(a%2==0){
        min=a/2-1;
        if(prime[a/2])
          cnt++;
        for(int i=min;min>1;min--){
              if(prime[min]){
                if(prime[min]==prime[a-min]){
                  cnt++;
                }
              }
        }
      }else{
        cnt=0;
      }
      cout << cnt << endl;;
      cnt=0;
  }
  return 0;
}or(int i=2;i*i<50000;i++){
    if(prime[i]){
      for(int j=i*i;j<50000; j+=i){
        prime[j]=false;
      }
    }
  }

  while(true){
    int min,a,cnt;
    cin >> a;

    if(a==0)
      break;

      if(a%2==0){
        min=a/2-1;
        if(prime[a/2])
          cnt++;
        for(int i=min;min>1;min--){
              if(prime[min]){
                if(prime[min]==prime[a-min]){
                  cnt++;
                }
              }
        }
      }else{
        cnt=0;
      }
      cout << cnt << endl;;
      cnt=0;
  }
  return 0;
}



Compiler output:
a.cc:44:2: error: expected unqualified-id before 'or' token
   44 | }or(int i=2;i*i<50000;i++){
      |  ^~
a.cc:44:13: error: 'i' does not name a type
   44 | }or(int i=2;i*i<50000;i++){
      |             ^
a.cc:44:23: error: 'i' does not name a type
   44 | }or(int i=2;i*i<50000;i++){
      |                       ^
a.cc:52:3: error: expected unqualified-id before 'while'
   52 |   while(true){
      |   ^~~~~
a.cc:76:3: error: expected unqualified-id before 'return'
   76 |   return 0;
      |   ^~~~~~
a.cc:77:1: error: expected declaration before '}' token
   77 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <bitset>
#include <vector>

using namespace std;

int main()
{
  bitset<60001> is_prime;
  is_prime.set();
  is_prime[0] = false, is_prime[1] = true;
  for (int i = 2; i * i <= 60000; i++) {
    for (int j = i + i; j <= 60000; j += i) {
      is_prime[j] = false;
    }
  }
  vector<int> prime;
  for (int i = 0; i <= 60000; i++) {
    if (is_prime[i]) {prime.push_back(i);}
  }
  
  int n;
  while (scanf("%d ", &n) == 1) {
    if (n == 0) {break;}
    int c = 0;
    for (int i = 0; i < prime.size(); i++) {
      if (prime[i] > n / 2) {break;}
      if (is_prime[n - prime[i]]) {c++;}
    }
    printf("%d\n", c);
  }
  return 0;
}

#include <iostream>
#include <cstdio>
#include <bitset>
#include <vector>

using namespace std;

int main()
{
  bitset<60001> is_prime;
  is_prime.set();
  is_prime[0] = false, is_prime[1] = true;
  for (int i = 2; i * i <= 60000; i++) {
    for (int j = i + i; j <= 60000; j += i) {
      is_prime[j] = false;
    }
  }
  vector<int> prime;
  for (int i = 0; i <= 60000; i++) {
    if (is_prime[i]) {prime.push_back(i);}
  }
  
  int n;
  while (scanf("%d ", &n) == 1) {
    if (n == 0) {break;}
    int c = 0;
    for (int i = 0; i < prime.size(); i++) {
      if (prime[i] > n / 2) {break;}
      if (is_prime[n - prime[i]]) {c++;}
    }
    printf("%d\n", c);
  }
  return 0;
}

Compiler output:
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main()
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main()
      |     ^~~~
Language: C++

include <iostream>
using namespace std;

int main(){
	int n;
	const int max = 50000;
	int a[max];
	a[1] = 0;
	for(int i = 2; i < max; i++) a[i] = 1;
	for(int i = 2; i * i <= max; i++){
		for(int j = 2; j*i <= max; j++){
			a[i*j] = 0;
		}
	}
	while(cin >> n){
		if(n == 0) break;
		int count = 0;
		if(n % 2 == 1){
			if(a[n-2]){
				cout << 1 << endl;
			}else{
				cout << 0 << endl;
			}
		}else{
			for(int i = 2; i <= n-i; i++)
				if(a[i] && a[n-i])
					count++;
			cout << count <<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:15:15: error: 'cin' was not declared in this scope
   15 |         while(cin >> n){
      |               ^~~
a.cc:20:33: error: 'cout' was not declared in this scope; did you mean 'count'?
   20 |                                 cout << 1 << endl;
      |                                 ^~~~
      |                                 count
a.cc:20:46: error: 'endl' was not declared in this scope
   20 |                                 cout << 1 << endl;
      |                                              ^~~~
a.cc:22:33: error: 'cout' was not declared in this scope; did you mean 'count'?
   22 |                                 cout << 0 << endl;
      |                                 ^~~~
      |                                 count
a.cc:22:46: error: 'endl' was not declared in this scope
   22 |                                 cout << 0 << endl;
      |                                              ^~~~
a.cc:28:25: error: 'cout' was not declared in this scope; did you mean 'count'?
   28 |                         cout << count <<endl;
      |                         ^~~~
      |                         count
a.cc:28:41: error: 'endl' was not declared in this scope
   28 |                         cout << count <<endl;
      |                                         ^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

bool isprime (int n){

	if (n == 0 || n == 1){
		return false;
	}else if (n == 2){
		return true;
	}else if (n % 2 == 0){
		return false;
	} // end if
	
	for (int i = 3; i <= sqrt(n); i+= 2){
		if (n % i == 0){
			return false;
		} // end if
	} // end for
		
	return true;
}

int main()
{
//	cut here before submit 
//	freopen("testcase.gold", "r", stdin);
	string str = "";
	while (getline (cin, str ) ){
		int n;
		stringstream ss(str);
		ss >> n;
		if (n == 0){
			break;
		} // end if
		int i;
		int res = 0;
		if (prime(n-2)){
			++res;
		} // end if
		for (i = 3; i <= (n + 1)/2; i += 2){
			if (isprime(i) && isprime(n-i) ){
				++res;
			} // end for
		} // end for
		cout << res << endl;
	} // end loop
		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:21: error: 'prime' was not declared in this scope
   56 |                 if (prime(n-2)){
      |                     ^~~~~
Language: C++

#include <cstdio>
#include <cmath>
using namespace std;
/*bool prime(int num) 
{
    if (num==1) return false;
    if (num==2) return true;
    if (num%2==0) return false;
    for (int i=3; i<=sqrt(num); i+=2) {
        if (num%i==0) return false;
    }
    return true;
    }*/
bool suspect(Int a, int s, Int d, Int n) {
  Int x = powMod(a, d, n);
  if (x == 1) return true;
  for (int r = 0; r < s; ++r) {
    if (x == n - 1) return true;
    x = x * x % n;
  }
  return false;
}
// {2,7,61,-1}                 is for n < 4759123141 (= 2^32)
// {2,3,5,7,11,13,17,19,23,-1} is for n < 10^16 (at least)
bool isPrime(Int n) {
  if (n <= 1 || (n > 2 && n % 2 == 0)) return false;
  int test[] = {2,3,5,7,11,13,17,19,23,-1};
  Int d = n - 1, s = 0;
  while (d % 2 == 0) ++s, d /= 2;
  for (int i = 0; test[i] < n && test[i] != -1; ++i)
    if (!suspect(test[i], s, d, n)) return false;
  return true;
}
int main() 
{
    int n;
    while (scanf("%d",&n)&&n!=0) {
        int res=0;
        if (n%2!=0) {
            printf("0\n");
            continue;
        }
        for (int i=1; i<=n/2; i++) {
            if (n-i<i) break;
            if (isPrime(i)&&isPrime(n-i)) {
                res++;
            }
        }
        printf("%d\n",res);
    }
}

Compiler output:
a.cc:14:14: error: 'Int' was not declared in this scope; did you mean 'int'?
   14 | bool suspect(Int a, int s, Int d, Int n) {
      |              ^~~
      |              int
a.cc:14:21: error: expected primary-expression before 'int'
   14 | bool suspect(Int a, int s, Int d, Int n) {
      |                     ^~~
a.cc:14:28: error: 'Int' was not declared in this scope; did you mean 'int'?
   14 | bool suspect(Int a, int s, Int d, Int n) {
      |                            ^~~
      |                            int
a.cc:14:35: error: 'Int' was not declared in this scope; did you mean 'int'?
   14 | bool suspect(Int a, int s, Int d, Int n) {
      |                                   ^~~
      |                                   int
a.cc:14:40: error: expression list treated as compound expression in initializer [-fpermissive]
   14 | bool suspect(Int a, int s, Int d, Int n) {
      |                                        ^
a.cc:25:14: error: 'Int' was not declared in this scope; did you mean 'int'?
   25 | bool isPrime(Int n) {
      |              ^~~
      |              int
a.cc: In function 'int main()':
a.cc:45:24: error: 'isPrime' cannot be used as a function
   45 |             if (isPrime(i)&&isPrime(n-i)) {
      |                 ~~~~~~~^~~
a.cc:45:36: error: 'isPrime' cannot be used as a function
   45 |             if (isPrime(i)&&isPrime(n-i)) {
      |                             ~~~~~~~^~~~~
Language: C++

c[60000],j,n;main(i){for(i=2;i*i<5e4;i++)for(j=i;!c[i]&&j<5e4;c[j+=i]=1);for(;scanf("%d",&j),*c=j;n=!printf("%d\n",n))for(i=2;i<=j/2;n+=!(c[i]+c[j-i++]));exit(0);}

Compiler output:
a.cc:1:1: error: 'c' does not name a type
    1 | c[60000],j,n;main(i){for(i=2;i*i<5e4;i++)for(j=i;!c[i]&&j<5e4;c[j+=i]=1);for(;scanf("%d",&j),*c=j;n=!printf("%d\n",n))for(i=2;i<=j/2;n+=!(c[i]+c[j-i++]));exit(0);}
      | ^
a.cc:1:18: error: expected constructor, destructor, or type conversion before '(' token
    1 | c[60000],j,n;main(i){for(i=2;i*i<5e4;i++)for(j=i;!c[i]&&j<5e4;c[j+=i]=1);for(;scanf("%d",&j),*c=j;n=!printf("%d\n",n))for(i=2;i<=j/2;n+=!(c[i]+c[j-i++]));exit(0);}
      |                  ^
Language: C++

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String args[]) {
		ArrayList<Integer> al = new ArrayList<Integer>();
		{
			boolean p[] = new boolean[50001];
			for(int i = 0; i < 50001; i++) {
				p[i] = true;
			}
			p[0] = false;
			p[1] = false;
			for(int i = 2; i < 50001; i++) {
				if(p[i]) {
					al.add(i);
					if(i*i < 50001)
						for(int j = 2*i; j < 50001; j += i)
							p[j] = false;
				}
			}
		}
		for(;;) {
			int n = sc.nextInt();
			if(n == 0) break;
			int ans = 0;
			for(int i : al) {
				if(2 * i > n) break;
				if(Collections.binarySearch(al, n - i) >= 0) {
					ans ++;
				}
			}
			System.out.println(ans);
		}
	}
}

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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String args[]) {
		ArrayList<Integer> al = new ArrayList<Integer>();
		{
			boolean p[] = new boolean[50001];
			for(int i = 0; i < 50001; i++) {
				p[i] = true;
			}
			p[0] = false;
			p[1] = false;
			for(int i = 2; i < 50001; i++) {
				if(p[i]) {
					al.add(i);
					if(i*i < 50001)
						for(int j = 2*i; j < 50001; j += i)
							p[j] = false;
				}
			}
		}
		for(;;) {
			int n = sc.nextInt();
			if(n == 0) break;
			if(n % 2 != 0) {
				System.out.println(0);
				continue;
			}
			int ans = 0;
			for(int i : al) {
				if(2 * i > n) break;
				if(Collections.binarySearch(al, n - i) >= 0) {
					ans ++;
				}
			}
			System.out.println(ans);
		}
	}
}

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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

			if(i % v[j] == 0){f=false;break;}
		}
		if(f)v.push_back(i),isprime[i] = 1;
	}

	int n, res = 0;
	while(std::cin >> n, n){
		res = 0;
		for(int i=2;i<=n/2;i++){
			// for(int j=i;v[i]+v[j]<=n;j++){
			// 	if(v[i]+v[j] == n)res++;
			// }
			if(isprime[i] && isprime[n-i])res++;
			//std::cout << i << "," << n-i << std::endl;
		}
		std::cout << res << std::endl;
	}
	
	return 0;
}

Compiler output:
a.cc:1:25: error: expected unqualified-id before 'if'
    1 |                         if(i % v[j] == 0){f=false;break;}
      |                         ^~
a.cc:2:17: error: expected declaration before '}' token
    2 |                 }
      |                 ^
a.cc:3:17: error: expected unqualified-id before 'if'
    3 |                 if(f)v.push_back(i),isprime[i] = 1;
      |                 ^~
a.cc:4:9: error: expected declaration before '}' token
    4 |         }
      |         ^
a.cc:7:9: error: expected unqualified-id before 'while'
    7 |         while(std::cin >> n, n){
      |         ^~~~~
a.cc:19:9: error: expected unqualified-id before 'return'
   19 |         return 0;
      |         ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include<stdio.h>
int x[5133],i,j,n,num,sum,a;
int main(){
for(i=2;;i++){
for(j=2;j*j<=i;j++){
if(i!=j){if(i%j==0){num=1; break;}}}
if(num==0){x[a]=i; a++;}num=0;
if(a==5133) break;
}
while(1){
scanf("%d",&n);
if(n==0) break;
if(n%2==1){
for(j=0;x[j]<=n;j++){
if(x[j]==n-2) {sum++; break;}
}}
else{
for(i=0;x[i]<=n/2;i++){
for(j=0;x[j]<=n;j++){
if(x[i]+x[j]==n) {sum++; break;}
}}
printf("%d\n",sum);
sum=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <cstring>	// require memset 

using namespace std;

const int N = 50000;
bool prime[N+1];

void make_prime (void)
{
	int i,j;
	memset (prime, true , sizeof(prime ) );

	int i, j;

	prime[0] = false;
	prime[1] = false;

	for (i = 2; i*i <= N; ++i ) {
		if (prime[i] ) {
			for (j = i*i; j <= N; j += i ) {
				prime[j] = false;
			} // end for
		} // end if
	} // end for
}

int main()
{
	int n;
	make_prime();

	while (cin >> n && n ) {
		int res = 0;

		for (int i = 2; i <= n/2; ++i ) {
			if (prime[i] && prime[n-i] ){
				++res;
			} // end for
		} // end for
		cout << res << endl;
	} // end loop
		
	return 0;
}

Compiler output:
a.cc: In function 'void make_prime()':
a.cc:14:13: error: redeclaration of 'int i'
   14 |         int i, j;
      |             ^
a.cc:11:13: note: 'int i' previously declared here
   11 |         int i,j;
      |             ^
a.cc:14:16: error: redeclaration of 'int j'
   14 |         int i, j;
      |                ^
a.cc:11:15: note: 'int j' previously declared here
   11 |         int i,j;
      |               ^
Language: C++

#include <iostream>
#include <cstring>
using namespace std;

int prime[51000];
int ch[10000];

int main(){
  int n;
  int cnt;
  int k;
  while(1){
    memset(prime,0,sizeof(prime));
    cnt = 0;
    cin >> n;
    if(n == 0) break;
    for(int i=2;i<=n/2;i++){
      for(int j=2;j<=n;j++){
	prime[i*j] = 1;
      }
    }
    k = 0;
    for(int i=2;i<=n;i++){
      if(prime[i] == 0){
	ch[k] = i;
	k++;
      }
    }
    for(int i=0;i<k;i++){
      for(int j=i;j<k;j++){
	if(ch[i] + ch[j] == n) cnt++;
      }
    }
    cout << cnt << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

include <iostream>
#define STA 50000
using namespace std;

int prime[50001];

int main(){
  int n;
  int cnt;
  for(int i=2;i<=STA/2;i++){
    for(int j=2;i*j<=STA;j++){
      prime[i*j] = 1;
    }
  }
  while(1){
    cnt = 0;
    cin >> n;
    if(n == 0) break;
    for(int i=2;i<=n/2;i++){
	if(prime[i] == 0 && prime[n-i] == 0) cnt++;
    }
    cout << cnt << endl;
  }
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:17:5: error: 'cin' was not declared in this scope
   17 |     cin >> n;
      |     ^~~
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << cnt << endl;
      |     ^~~~
a.cc:22:20: error: 'endl' was not declared in this scope
   22 |     cout << cnt << endl;
      |                    ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define X first
#define Y second
using namespace std;

void era(bool *table){
	for(int i = 2; i <= 50000; i++){
		if(table[i]){
			for(int j = i*2; j <= 50000; j+=i){
				table[j] = false;
			}
		}
	}
}

int main(){
	bool table[50001];
	memset(table, true, sizeof(table));
	era(table);
	int n;
	while(cin >> n && n != 0){
		int count = 0;
		if(n%2){
			cout << 0 << endl;
			break;
		}
		for(int i = 1; i <= n; i++){
			for(int j = i; j <= n; j++){
				if(!table[i]||!table[j]) continue;
				if(i+j==n) count++;
				if(i+j>n) break;
			}
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'memset' was not declared in this scope
   28 |         memset(table, true, sizeof(table));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 |
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define X first
#define Y second
using namespace std;

void era(bool *table){
	for(int i = 2; i <= 50000; i++){
		if(table[i]){
			for(int j = i*2; j <= 50000; j+=i){
				table[j] = false;
			}
		}
	}
}

int main(){
	bool table[50001];
	memset(table, true, sizeof(table));
	era(table);
	int n;
	while(cin >> n && n != 0){
		int count = 0;
		if(n%2){
			cout << 0 << endl;
			continue;
		}
		for(int i = 1; i <= n; i++){
			for(int j = i; j <= n; j++){
				if(!table[i]||!table[j]) continue;
				if(i+j==n) count++;
				if(i+j>n) break;
			}
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'memset' was not declared in this scope
   28 |         memset(table, true, sizeof(table));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 |
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define X first
#define Y second
using namespace std;

void era(bool *table){
	for(int i = 2; i <= 50000; i++){
		if(table[i]){
			for(int j = i*2; j <= 50000; j+=i){
				table[j] = false;
			}
		}
	}
}

int main(){
	bool table[50001];
	memset(table, true, 50001);
	era(table);
	int n;
	while(cin >> n && n != 0){
		int count = 0;
		if(n%2){
			cout << 0 << endl;
			continue;
		}
		for(int i = 1; i <= n; i++){
			for(int j = i; j <= n; j++){
				if(!table[i]||!table[j]) continue;
				if(i+j==n) count++;
				if(i+j>n) break;
			}
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'memset' was not declared in this scope
   28 |         memset(table, true, 50001);
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 |
Language: C++

#include <iostream>
#include <vector>
typedef std::vector <int> vi;

vi PRIMES,S;
int prime(int n){
    int i=0,j=1,h=(n+1)/2,x,r=(int)pow(n,.5);
    vi s(h),p;
    while(j<=n){
        s[i++]=j;
        j+=2;
    }
    for (i=1;i<h;i++)
        if (x=s[i]){
            p.push_back(x);
            if (i<=r) for (j=x*x/2;j<h;j+=x) s[j]=0;
        }
	PRIMES=p;
	S=s;
    return 0;
}
int f0056(int n){
	int x=0;
	if (n<4) return 0;
	if (n==4) return 1;
	if (n%2==1)	if (S[(n-2)/2]) return 1;
	for (int e: PRIMES){
		if (e>n/2) break;
		if (S[(n-e)/2]) x++;
	}
	return x;
}
int main(void){
    int n;
    prime(105000);
    while (true){
        std::cin>>n; if (n==0) break;
        std::cout<<f0056(n)<<"\n";
    }
} 

Compiler output:
a.cc: In function 'int prime(int)':
a.cc:7:36: error: 'pow' was not declared in this scope
    7 |     int i=0,j=1,h=(n+1)/2,x,r=(int)pow(n,.5);
      |                                    ^~~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Question04 {

	public static void main(String[] args) {


		Scanner stdin = new Scanner(System.in);
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		int a = 2;
		int aN = 0;
		int b = 0;

		while(stdin.hasNext()) {
			int n = stdin.nextInt();
			
			for(int i = 0; i < n - 1; i++) {
				
				b += i + 2;

			}

			aN = a + b;
			System.out.println(aN);
			b = 0;

		}

	}

}

Compiler output:
Main.java:5: error: class Question04 is public, should be declared in a file named Question04.java
public class Question04 {
       ^
1 error