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


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int height(vint& v, int w)
{
	int res = 0, pl = 0;
	
	rep(i, v.size())
	{
		if(w < pl + v[i])
		{
			res++;
			
			if(w < v[i]) return INT_MAX;
			
			pl = 0;
		}
		
		pl += v[i];
	}
	
	return res + (pl != 0);
}

int main()
{
	int m, n;
	while(cin >> m >> n && n)
	{		
		vint v(n);
		rep(i, n) cin >> v[i];
		
		double lb = 1, ub = 1500000;
		
		rep(i, 10000)
		{
			double mid = (ub + lb) / 2;
			
			if(height(v, ceil(mid)) <= m) ub = mid;
			else lb = mid;
		}
		
		cout << ceil(ub) << endl;
	}
}

Compiler output:
a.cc: In function 'int height(vint&, int)':
a.cc:49:45: error: 'INT_MAX' was not declared in this scope
   49 |                         if(w < v[i]) return INT_MAX;
      |                                             ^~~~~~~
a.cc:25:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   24 | #include <fstream>
  +++ |+#include <climits>
   25 | using namespace std;
Language: C++

#include<iostream>

using namespace std;

int m, n;
hon[100];

int f(int w) {
	int honIdx = 0;
	for (int i = 0; i < m; i++) {
		int curW = w;
		while (hon[honIdx] <= curW) {
			curW -= hon[honIdx];
			honIdx++;
			if (honIdx == n) return 1;
		}
	}
	return 0;
}

int binsearch_lower_bound() {
  int low = 0; // 範囲の下限
  int high = 1000000 + 1; // 範囲の上限。解はあれば [low, high] の中に存在する
  while (low < high) {
    int mid = (low + high) / 2;  // 中心点（この実装ではオーバーフローしうるので注意）
    int midval = f(mid);  // 中心での値
    
    // 解の範囲を狭める
    if (midval < 1) low = mid + 1;
    else high = mid;
  }
  return low;
}

int main() {
	while(cin >> m >> n, m || n) {
		for (int i = 0; i < n; i++) {
			cin >> hon[i];
		}
		cout << binsearch_lower_bound() << endl;
	}
	return 0;
}

Compiler output:
a.cc:6:1: error: 'hon' does not name a type
    6 | hon[100];
      | ^~~
a.cc: In function 'int f(int)':
a.cc:12:24: error: 'hon' was not declared in this scope
   12 |                 while (hon[honIdx] <= curW) {
      |                        ^~~
a.cc: In function 'int main()':
a.cc:38:32: error: 'hon' was not declared in this scope
   38 |                         cin >> hon[i];
      |                                ^~~
Language: Java

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

//Beaker
public class Main {

	int n;
	int[] a;
	boolean[] have, t;
	
	boolean dfs(int k, int rest){
		if(rest==0){
			for(int i=0;i<n;i++)t[i]=have[i];
			return greedy();
		}
		if(rest < a[k])return false;
		have[k] = true;
		if(dfs(k+1, rest-a[k]))return true;
		have[k] = false;
		return dfs(k+1, rest);
	}
	
	boolean choice(int k, int rest){
		if(rest==0)return true;
		if(k<0)return false;
		if(!t[k])return choice(k-1, rest);
		if(a[k]<=rest){
			t[k] = false;
			if(choice(k-1, rest-a[k]))return true;
			t[k] = true;
		}
		return choice(k-1, rest);
	}
	
	boolean greedy(){
		for(int i=0;i<n;i++)if(!t[i]){
			if(!choice(i-1, a[i]))return false;
			t[i] = true;
		}
		return true;
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		t = new boolean[100];
		have = new boolean[100];
		for(;;){
			n = sc.nextInt();
			if(n==0)break;
			a = new int[n];
			for(int i=0;i<n;i++){
				a[i] = sc.nextInt();
			}
			Arrays.sort(a);
			Arrays.fill(have, false);
			have[0] = true;
			System.out.println(dfs(1, a[n-1]-a[0])?"YES":"NO");
		}
	}
	
	public static void main(String[] args) {
		new AOJ0182().run();
	}
}

Compiler output:
Main.java:62: error: cannot find symbol
		new AOJ0182().run();
		    ^
  symbol:   class AOJ0182
  location: class Main
1 error
Language: C++

#include<iostream>
#include<vector>
#include<bitset>
#include<set>
#include<tuple>
#include<algorithm>
#include<functional>
using namespace std;

const int N = 50;

int n;
vector<int> beaker;
bitset<N> full;
bitset<N> used;

bool pour(int water, int start);
bool check();

bool pour(int water, int start) {
    for(int i = start; i < n; ++i) {
        if(full[i] || used[i]) continue;

        if(water < beaker[i]) continue;
        else if(water == beaker[i]) {
            full.set(i);
            used.set(i);
            if(check()) return true;
            full.reset(i);
            used.reset(i);
        } else {
            full.set(i);
            used.set(i);
            if(pour(water - beaker[i], i + 1)) return true;
            full.reset(i);
            used.reset(i);
        }
    }
    return false;
}

bool check() {
    if(used.count() == n) return true;
    for(int i = 0; i < n; ++i) {
        if(!full[i]) continue;
        full.reset(i);
        if(pour(beaker[i], i + 1)) return true;
        full.set(i);
    }
    return false;
}

int main() {
    while(cin >> n, n) {
        beaker.resize(n);
        for(auto& b: beaker) cin >> b;
        sort(beaker.begin(), beaker.end(), greater<int>());
        full = bitset<N>(1);
        used = bitset<N>(1);
        memo.clear();
        cout << (check() ? "YES" : "NO") << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: 'memo' was not declared in this scope
   60 |         memo.clear();
      |         ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

#define FREE 0
#define TRIED 1
#define LOCKED 2
#define DONE 3
//0182
int main(){
	int n,x;

	while(cin >> n, n){
		vector<int> v1;
		int capacity=0;
		char used[10]={0}; //0:free 1:tried 2:locked 3:done
		//char *used = new char[n];

		for(int i=0; i<n; ++i){
			cin >> x;
			capacity+=x;
			v1.push_back(x);
		}
		sort(v1.begin(),v1.end(), greater<int>());

		//int target=v1[0];
		used[0]=LOCKED;
		//capacity-=v1[0];
		int temp_capacity = capacity;
		bool isCancel=true;
		bool isComplete=true;
		for(int i=0; i<n; ++i){
			if(used[i]!=LOCKED){
				continue;
			}
			if(n==1){
				used[0]=DONE;
				break;
			}

			int temp_target=v1[i];
			for(int i=0; i<n; ++i){
				if(used[i]!=FREE){
					continue;
				}
				if(temp_target>=v1[i]){
					used[i]=TRIED;
					capacity-=v1[i];
					temp_target-=v1[i];
					temp_capacity-=v1[i];
				}	
			}
			if(temp_target==0){
				isCancel = false;
			}
			
			for(int i=0; i<n; ++i){
				if(isCancel){
					if(used[i]==TRIED){
						used[i]=FREE;
						temp_capacity+=v1[i];
					}
				}else{
					if(used[i]==LOCKED){
						used[i]=DONE;
					}
					if(used[i]==TRIED){
						used[i]=LOCKED;
					}
				}
			}
		}

		for(int i=0; i<n; ++i){
			if(used[i]!=DONE)
				isComplete=false;
		}
		cout << (isComplete ? "YES" : "NO") << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |                 sort(v1.begin(),v1.end(), greater<int>());
      |                 ^~~~
      |                 short
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>

using namespace std;

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

int n;
int C[50];
bool used[50];
bool full[50];

bool searchFrom();

bool searchTo(int v, int src)
{
	reps(i, src+1, n){
		if(!used[i]){
			full[i] = used[i] = true;
			if(C[i] == v){
				if(searchFrom())
					return true;
			}
			else if(C[i] < v && searchTo(v-C[i], i))
				return true;
			full[i] = used[i] = false;
		}
	}
	
	return false;
}

bool searchFrom()
{
	int unused = -1;
	rep(i, n){
		if(!used[i]){
			unused = i;
			break;
		}
	}
	if(unused == -1)
		return true;
	
	rep(i, unused){
		if(full[i]){
			full[i] = false;
			if(searchTo(C[i], i))
				return true;
			full[i] = true;
		}
	}
	return false;
}

int main()
{
	while(scanf("%d", &n), n){
		rep(i, n)
			scanf("%d", &C[i]);
		
		rep(i, 101)
			visited[i].clear();
		sort(C, C+n, greater<int>());
		fill(used, used+n, false);
		fill(full, full+n, false);
		used[0] = full[0] = true;
		puts(searchFrom() ? "YES" : "NO");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:25: error: 'visited' was not declared in this scope
   83 |                         visited[i].clear();
      |                         ^~~~~~~
Language: C++

#include<cstdio>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

bool dfs(int i);

int n,a[50];

bool vis[50],fil[50];

bool dfs2(int i,int j,int rem){ // partition
	if(rem==0) return dfs(i+1);
	if(j==n) return false;

	if(!vis[j] && a[j]<=rem){
		vis[j]=fil[j]=true;
		if(dfs2(i,j+1,rem-a[j])) return true;
		vis[j]=fil[j]=false;
	}
	return dfs2(i,j+1,rem);
}

bool dfs(int i){
	if(i==n) return true;

	if(!vis[i]) return false;

	if(dfs(i+1)) return true;
	if(fil[i]){
		fil[i]=false;
		if(dfs2(i,i+1,a[i])) return true;
		fil[i]=true;
	}
	return false;
}

int main(){
	for(;scanf("%d",&n),n;){
		rep(i,n){
			scanf("%d",a+i);
			vis[i]=fil[i]=false;
		}
		sort(a,a+n,greater<int>());
		vis[0]=fil[0]=true;
		puts(dfs(0)?"YES":"NO");
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:28: error: 'greater' was not declared in this scope
   46 |                 sort(a,a+n,greater<int>());
      |                            ^~~~~~~
a.cc:46:36: error: expected primary-expression before 'int'
   46 |                 sort(a,a+n,greater<int>());
      |                                    ^~~
Language: C

#include<stdio.h>

int main(){
    int b[3][3];
    int i,j;

    while(1){
        for(i=0;i<3;i++){
            for(j=0;j<3;j++){
                scanf("%d",&b[i][j]);
                if(board[i][j]==0)return 0;
            }   
        }   
        if(b[0][0]==b[0][1]&&b[0][1]==b[0][2]&&b[0][2]==b[0][0]){
            if(!(b[0][0]=='+')){
                printf("%c\n",b[0][0]);
                continue;
            }   
        }   
        if(b[1][0]==b[1][1]&&b[1][1]==b[1][2]&&b[1][2]==b[1][0]){
            if(!(b[1][0]=='+')){
                printf("%c\n",b[1][0]);
                continue;
            }   
        }   
        if(b[2][0]==b[2][1]&&b[2][1]==b[2][2]&&b[2][2]==b[2][0]){
            if(!(b[2][0]=='+')){
                printf("%c\n",b[2][0]);
                continue;
            }   
        }   
        if(b[0][0]==b[1][0]&&b[1][0]==b[2][0]&&b[2][0]==b[0][0]){
            if(!(b[0][0]=='+')){
                printf("%c\n",b[0][0]);
                continue;
            }   
        }   
        if(b[0][1]==b[1][1]&&b[1][1]==b[2][1]&&b[2][1]==b[0][1]){
            if(!(b[0][1]=='+')){
                printf("%c\n",b[0][1]);
                continue;
            }   
        }   
        if(b[0][2]==b[1][2]&&b[1][2]==b[2][2]&&b[2][2]==b[0][2]){
            if(!(b[0][2]=='+')){
                printf("%c\n",b[0][2]);
                continue;
            }   
        }   
        if(b[0][0]==b[1][1]&&b[1][1]==b[2][2]&&b[2][2]==b[0][0]){
            if(!(b[0][0]=='+')){
                printf("%c\n",b[0][0]);
                continue;
            }   
        }   
        if(b[2][0]==b[1][1]&&b[1][1]==b[0][2]&&b[0][2]==b[2][0]){
            if(!(b[2][0]=='+')){
                printf("%c\n",b[2][0]);
                continue;
            }   
        }   
    }   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:20: error: 'board' undeclared (first use in this function)
   11 |                 if(board[i][j]==0)return 0;
      |                    ^~~~~
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void) {
	char input[3][4];
	int win;
	while(1) {
		gets(input[0]);
		if(input[0][0]=='0')break;
		gets(input[1]);
		gets(input[2]);
		win=0;
		for(i=0;i<3;i++) {
			if(input[i][0]==input[i][1] &&
			   input[i][1]==input[i][2] &&
			   input[i][0]!='+') {
				printf("%c\n",input[i][0]);
				win=1;
				break;
			}
			if(input[0][i]==input[1][i] &&
			   input[1][i]==input[2][i] &&
			   input[0][i]!='+') {
				printf("%c\n",input[0][i]);
				win=1;
				break;
			}
		}
		if(!win) {
			if(input[0][0]==input[1][1] &&
			   input[1][1]==input[2][2] &&
			   input[0][0]!='+')printf("%c\n",input[0][0]);
			else if(input[0][2]==input[1][1] &&
			        input[1][1]==input[2][0] &&
			        input[0][2]!='+')printf("%c\n",input[0][2]);
			else puts("NA");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |                 gets(input[0]);
      |                 ^~~~
      |                 fgets
main.c:12:21: error: 'i' undeclared (first use in this function)
   12 |                 for(i=0;i<3;i++) {
      |                     ^
main.c:12:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void) {
	char input[3][4];
	int win;
	int i;
	while(1) {
		gets(input[0]);
		if(input[0][0]=='0')break;
		gets(input[1]);
		gets(input[2]);
		win=0;
		for(i=0;i<3;i++) {
			if(input[i][0]==input[i][1] &&
			   input[i][1]==input[i][2] &&
			   input[i][0]!='+') {
				printf("%c\n",input[i][0]);
				win=1;
				break;
			}
			if(input[0][i]==input[1][i] &&
			   input[1][i]==input[2][i] &&
			   input[0][i]!='+') {
				printf("%c\n",input[0][i]);
				win=1;
				break;
			}
		}
		if(!win) {
			if(input[0][0]==input[1][1] &&
			   input[1][1]==input[2][2] &&
			   input[0][0]!='+')printf("%c\n",input[0][0]);
			else if(input[0][2]==input[1][1] &&
			        input[1][1]==input[2][0] &&
			        input[0][2]!='+')printf("%c\n",input[0][2]);
			else puts("NA");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |                 gets(input[0]);
      |                 ^~~~
      |                 fgets
Language: C

#include <stdio.h>

int main(void) {
	char input[3][12];
	int win;
	int i;
	while(1) {
		fgets(input[0],sizeof(input[0],stdin);
		if(input[0][0]=='0')break;
		fgets(input[1],sizeof(input[1],stdin);
		fgets(input[2],sizeof(input[2],stdin);
		win=0;
		for(i=0;i<3;i++) {
			if(input[i][0]==input[i][1] &&
			   input[i][1]==input[i][2] &&
			   input[i][0]!='+') {
				printf("%c\n",input[i][0]);
				win=1;
				break;
			}
			if(input[0][i]==input[1][i] &&
			   input[1][i]==input[2][i] &&
			   input[0][i]!='+') {
				printf("%c\n",input[0][i]);
				win=1;
				break;
			}
		}
		if(!win) {
			if(input[0][0]==input[1][1] &&
			   input[1][1]==input[2][2] &&
			   input[0][0]!='+')printf("%c\n",input[0][0]);
			else if(input[0][2]==input[1][1] &&
			        input[1][1]==input[2][0] &&
			        input[0][2]!='+')printf("%c\n",input[0][2]);
			else puts("NA");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:54: error: expected ')' before ';' token
    8 |                 fgets(input[0],sizeof(input[0],stdin);
      |                      ~                               ^
      |                                                      )
main.c:8:17: error: too few arguments to function 'fgets'
    8 |                 fgets(input[0],sizeof(input[0],stdin);
      |                 ^~~~~
In file included from main.c:1:
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
main.c:40:1: error: expected declaration or statement at end of input
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  char in[3][4];
  while(cin>>in[0],in[0][0]!='0'){
    rep(i,2)cin>>in[i+1];
    bool h=false;
    rep(i,3){
      if(in[0][i]==in[1][i]&&in[1][i]==in[2][i]&&in[0][i]!='+'){cout<<in[0][i]<<endl;h=true;break;}
      else if(in[i][0]==in[i][1]&&in[i][1]==in[i][2]&&in[i][0]!='+'){cout<<in[i][0]<<endl;h=true;break}
    }
    if(!h){
      if(in[0][0]==in[1][1]&&in[1][1]==in[2][2]&&in[0][0]!='+')cout<<in[0][0]<<endl;
      else if(in[2][0]==in[1][1]&&in[1][1]==in[0][2]&&in[1][1]!='+')cout<<in[1][1]<<endl;
      else cout<<"NA"<<endl;
    }
  }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:103: error: expected ';' before '}' token
   26 |       else if(in[i][0]==in[i][1]&&in[i][1]==in[i][2]&&in[i][0]!='+'){cout<<in[i][0]<<endl;h=true;break}
      |                                                                                                       ^
      |                                                                                                       ;
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<string>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1);
const double inf = (int)1e8;

int main(void){
  char maze[3][3];
  while(cin>>mazze[0][0]){
    if(maze[0][0] == '0')break;
    rep(i,3)rep(j,3){
      if(i==0&&j==0)continue;
      cin>>maze[i][j];
    }
    bool find = false;
    rep(i,3)if(maze[0][i] == maze[1][i] && 
	       maze[1][i] == maze[2][i] && 
	       maze[0][i] != '+'){
      cout<<maze[0][i]<<endl;
      find = true;
    }
    if(find)continue;
    rep(i,3)if(maze[i][0] == maze[1][i] && 
	       maze[i][1] == maze[2][i] && 
	       maze[i][2] != '+'){
      cout<<maze[i][1]<<endl;
      find = true;
    }
    if(find)continue;
    if(maze[0][0] == maze[1][1] && 
       maze[1][1] == maze[2][2] &&
       maze[1][1] != '+'){
      cout<<maze[0][0]<<endl;
      continue;
    }else if(maze[2][0] == maze[1][1] && 
	     maze[1][1] == maze[0][2] &&
	     maze[2][0] != '+'){
      cout<<maze[1][1]<<endl;
      continue;
    }else{
      cout<<"NA"<<endl;
    }
    
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: 'mazze' was not declared in this scope; did you mean 'maze'?
   15 |   while(cin>>mazze[0][0]){
      |              ^~~~~
      |              maze
Language: C++

include <bits/stdc++.h>
using namespace std;
 
int main()
{
  string str1, str2, str3;
  while (cin >> str1, str1 != "0"){
    bool b, w;
    b = w = false;
    cin >> str2 >> str3;
 
    if (str1[0] == str1[1] && str1[0] == str1[2]){
      if (str1[0] == 'b') b = true;
      if (str1[0] == 'w') w = true;
    }
    else if (str2[0] == str2[1] && str2[0] == str2[2]){
      if (str2[0] == 'b') b = true;
      if (str2[0] == 'w') w = true;
    }
    else if (str3[0] == str3[1] && str3[0] == str3[2]){
      if (str3[0] == 'b') b = true;
      if (str3[0] == 'w') w = true;
    }
    else if (str1[0] == str2[0] && str1[0] == str3[0]){
      if (str1[0] == 'b') b = true;
      if (str1[0] == 'w') w = true;
    }
    else if (str1[1] == str2[1] && str1[1] == str3[1]){
      if (str1[1] == 'b') b = true;
      if (str1[1] == 'w') w = true;
    }
    else if (str1[2] == str2[2] && str1[2] == str3[2]){
      if (str1[2] == 'b') b = true;
      if (str1[2] == 'w') w = true;
    }
    else if (str1[0] == str2[1] && str1[0] == str3[2]){
      if (str1[0] == 'b') b = true;
      if (str1[0] == 'w') w = true;
    }
    else if (str1[2] == str2[1] && str1[2] == str3[0]){
      if (str1[2] == 'b') b = true;
      if (str1[2] == 'w') w = true;
    }
 
    if (b)  cout << 'b';
    if (w) cout << 'w';
    if (!b && !w)cout << "NA";
    cout << endl;
  }
}
  

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string str1, str2, str3;
      |   ^~~~~~
a.cc:7:10: error: 'cin' was not declared in this scope
    7 |   while (cin >> str1, str1 != "0"){
      |          ^~~
a.cc:7:17: error: 'str1' was not declared in this scope
    7 |   while (cin >> str1, str1 != "0"){
      |                 ^~~~
a.cc:10:12: error: 'str2' was not declared in this scope
   10 |     cin >> str2 >> str3;
      |            ^~~~
a.cc:10:20: error: 'str3' was not declared in this scope
   10 |     cin >> str2 >> str3;
      |                    ^~~~
a.cc:45:13: error: 'cout' was not declared in this scope
   45 |     if (b)  cout << 'b';
      |             ^~~~
a.cc:46:12: error: 'cout' was not declared in this scope
   46 |     if (w) cout << 'w';
      |            ^~~~
a.cc:47:18: error: 'cout' was not declared in this scope
   47 |     if (!b && !w)cout << "NA";
      |                  ^~~~
a.cc:48:5: error: 'cout' was not declared in this scope
   48 |     cout << endl;
      |     ^~~~
a.cc:48:13: error: 'endl' was not declared in this scope
   48 |     cout << endl;
      |             ^~~~
Language: C

#include <stdio.h>

int sum[7];
int main(void)
{
	int i, j, n, g;
	
	while (scanf("%d", &n), n != 0){
		for (j = 0; j < n; j++){
			sacnf("%d", &g);
			if (G / 10 > 6){
				sum[6]++;
			}
			else {
				sum[g / 10]++;
			}
		}
		for (i = 0; i < 7; i++){
			printf("%d\n", sum[i]);
			sum[i] = 0;
		}
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:25: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |                         sacnf("%d", &g);
      |                         ^~~~~
      |                         scanf
main.c:11:29: error: 'G' undeclared (first use in this function)
   11 |                         if (G / 10 > 6){
      |                             ^
main.c:11:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int sum[7];
int main(void)
{
	int i, j, n, g;
	
	while (scanf("%d", &n), n != 0){
		for (j = 0; j < n; j++){
			sacnf("%d", &g);
			if (g / 10 > 6){
				sum[6]++;
			}
			else {
				sum[g / 10]++;
			}
		}
		for (i = 0; i < 7; i++){
			printf("%d\n", sum[i]);
			sum[i] = 0;
		}
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:25: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |                         sacnf("%d", &g);
      |                         ^~~~~
      |                         scanf
Language: C

#include <stdio.h>

int main(void)
{
	int n,i;
	int sum=0,a;
	int b[11]={0};
	
	while(scanf("%d",&n)&&n!=0){
		for(i=0;i<n;i++){
			scanf("%d",&a);
			b[a%10]++;
		}
		b[6]=b[6]+b[7]+b[8]+b[9]+b[10];
		printf("%d\n",n);
		for(i=0;i<7;i++){
			printf("%d\n",b[i]);
	}
	return 0 ;
}

Compiler output:
main.c: In function 'main':
main.c:20:1: error: expected declaration or statement at end of input
   20 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
	int n,i;
	int sum=0,a;
	int b[11]={0};
	
	while(scanf("%d",&n)&&n!=0){
		for(i=0;i<n;i++){
			scanf("%d",&a);
			if(a<60)
			b[a%10]++;
			else
			b[6]++;
		}
		b[6]=b[6]+b[7]+b[8]+b[9]+b[10];
		printf("%d\n",n);
		for(i=0;i<7;i++){
			printf("%d\n",b[i]);
	}
	return 0 ;
}

Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
	int n, a, c1, c2, c3, c4, c5, c6, c7;
	
	scanf("%d", &n);
	
	c1 = c2 = c3 = c4 = c5 = c6 = c7 = 0;
	
	while (n--){
		scanf("%d", &a);
		if (a < 10){
			c1++;
		}0
		else if (a < 20){
			c2++;
		}
		else if (a < 30){
			c3++;
		}
		else if (a < 40){
			c4++;
		}
		else if (a < 50){
			c5++;
		}
		else if (a < 60){
			c6++;
		}
		else {
			c7++;
		}
	}
	
	printf("%d\n%d\n%d\n%d\n%d\n%d\n%d", c1, c2, c3, c4, c5, c6, c7);
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:15:19: error: expected ';' before 'else'
   15 |                 }0
      |                   ^
      |                   ;
   16 |                 else if (a < 20){
      |                 ~~~~
Language: C

#include <stdio.h>

int main(void)
{
	int n;
	int age;
	int a_g[7] = {0};
	int i;
	
	while (1) {
		
		scanf("%d", &n);
		
		if (n == 0) {
			break;
		}
		else {
			for (i = 0; i < n; i++) {
				
				scanf("%d", &age);
				
				if ((age >= 0) && (age <= 9)) {
					a_g[0]++;
				}
				
				else if ((age >= 10) && (age <= 19)) {
					a_g[1]++;
				}
				
				else if ((age >= 20) && (age <= 29)) {
					a_g[2]++;
				}
				
				else if ((age >= 30) && (age <= 39)) {
					a_g[3]++;
				}
				
				else if ((age >= 40) && (age <= 49)) {
					a_g[4]++;
				}
				
				else if ((age >= 50) && (age <= 59)) {
					a_g[5]++;
				}
				
				else if (age >= 60) {
					a_g[6]++;
				}
			}
		}
		
		printf("%d\n", a_g[0]);
		printf("%d\n", a_g[1]);
		printf("%d\n", a_g[2]);
		printf("%d\n", a_g[3]);
		printf("%d\n", a_g[4]);
		printf("%d\n", a_g[5]);
		printf("%d\n", a_g[6]);
		
		age[7] = {0};
		
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:60:20: error: subscripted value is neither array nor pointer nor vector
   60 |                 age[7] = {0};
      |                    ^
main.c:60:26: error: expected expression before '{' token
   60 |                 age[7] = {0};
      |                          ^
Language: C

#include<stdio.h>

int main(void)
{
	int dataset = 0;
	int age;
	int i;
	int s;
	int pnum[7];
	scanf("%d",&dataset);
	for(i = 0;i < dataset;i++)
	{
		scanf("%d",&age);
		s = (age / 10);
		punm[s]++;
	}
	for(i = 0;i < 7;i++)
	{
		printf("%d\n",punm[i]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:17: error: 'punm' undeclared (first use in this function); did you mean 'pnum'?
   15 |                 punm[s]++;
      |                 ^~~~
      |                 pnum
main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void)
{
	int dataset = 0;
	int age;
	int i;
	int s;
	int pnum[7];
	scanf("%d",&dataset);
	for(i = 0;i < dataset;i++)
	{
		scanf("%d",&age);
		s = (age / 10);
		pnum[s]++;
	}
	for(i = 0;i < 7;i++)
	{
		printf("%d\n",punm[i]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:31: error: 'punm' undeclared (first use in this function); did you mean 'pnum'?
   19 |                 printf("%d\n",punm[i]);
      |                               ^~~~
      |                               pnum
main.c:19:31: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void)
{
	int dataset = 0;
	int age;
	int i;
	int s;
	int pnum[7] = 0;
	scanf("%d",&dataset);
	for(i = 0;i < dataset;i++)
	{
		scanf("%d",&age);
		if(age >= 70)
		{
			age = 60;
		}
		s = (age / 10);
		pnum[s]++;
	}
	for(i = 0;i < 7;i++)
	{
		printf("%d\n",pnum[i]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:23: error: invalid initializer
    9 |         int pnum[7] = 0;
      |                       ^
Language: C

#include<stdio.h>
int main(){
int a[200000],b[7],i,j,c;
while(1){i=0;
b[0]=0;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=0;b[6]=0;
scanf("%d",&c);
if(c==0)break;
while(i-c<0){
scanf("%d",&a[i]);
if(a[i]>=0&&a[i]<10)b{0}++;
if(a[i]>=10&&a[i]<20)b[1]++;
if(a[i]>=20&&a[i]<30)b[2]++;
if(a[i]>=30&&a[i]<40)b[3]++;
if(a[i]>=40&&a[i]<50)b[4]++;
if(a[i]>=50&&a[i]<60)b[5]++;
if(a[i]>=60)b[6]++;
i++;
}
for(j=0;j<7;j++)
printf("%d",b[j]);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: error: expected ';' before '{' token
   10 | if(a[i]>=0&&a[i]<10)b{0}++;
      |                      ^
      |                      ;
Language: C

#include<stdio.h>
int main(){
int n,a[7];
while(scanf("%d",&n),n){
for(i=0;i<n;i++){
scanf("%d",&x);
if(x<10)
a[0]++;
else if(x<20)
a[1]++;
else if(x<30)
a[2]++;
else if(x<40)
a[3]++;
else if(x<50)
a[4]++;
else if(x<60)
a[5]++;
else a[6]++;
}
for(i=0;i<7;i++)
printf("%d\n",a[i]);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:5: error: 'i' undeclared (first use in this function)
    5 | for(i=0;i<n;i++){
      |     ^
main.c:5:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:13: error: 'x' undeclared (first use in this function)
    6 | scanf("%d",&x);
      |             ^
Language: C

// include
// ----------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>

// repetition
// ----------------------------------------------------------------------------
#define FOR(i, a, b) for (i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// memory clear
// ----------------------------------------------------------------------------
#define CLRNUM(a) memset((a), 0, sizeof(a))
#define CLRBOOL(a, flag) memset((a), flag, sizeof(a))
#define CLRCHAR(a) memset((a), '\0', sizeof(a))

// debug
// ----------------------------------------------------------------------------
#define DEBUGINT(x) printf("%d\n", x);
#define DEBUGFLOAT(x) printf("%f\n", x);
#define DEBUGCHAR(x) printf("%c\n", x);
#define DEBUGSTR(x) printf("%s\n", x);
#define DEBUGFORINT(i, a, b, x) FOR(i, a, b){ printf("%d ", x[i]); }
#define DEBUGFORFLOAT(i, a, b,x ) FOR(i, a, b){ printf("%f ", x[i]); }
#define DEBUGFORCHAR(i, a, b, x) FOR(i, a, b){ printf("%c ", x[i]); }
#define DEBUGREPINT(i, n, x) REP(i, n){ printf("%d ", x[i]); }
#define DEBUGREPFLOAT(i, n, x) REP(i, n){ printf("%f ", x[i]); }
#define DEBUGREPCHAR(i, n, x) REP(i, n){ printf("%c ", x[i]); }

// other
// ----------------------------------------------------------------------------
#define PUTNL printf("\n")

// constant
// ----------------------------------------------------------------------------
#define INF 1000000000

int main(void)
{
    long long int n;
    int list[7];
    int old;
    int i;

    while (1){
        scanf("%lld", &n);

        if (n == 0){
            break;
        }

        CLRNUM(list);

        for (i = 0; i < n; ++i){
            scanf("%d", &old);

            if (old < 10){
                list[0]++;
            }
            else if (old > 9 && old < 20){
                list[1]++;
            }
            else if (old > 19 && old < 30){
                list[2]++;
            }
            else if (old > 29 && old < 40){
                list[3]++;
            }
            else if (old > 39 && old < 50){
                list[4]++;
            }
            else if (old > 49 && old < 60){
                list[5]++;
            }
            else if (old > 59){
                list[6]++;
            }
        }

        for (i = 0; i < 7; ++i){
            printf("%d\n", list[i]);
        }
    
        return 0;
    
    }

Compiler output:
main.c: In function 'main':
main.c:90:5: error: expected declaration or statement at end of input
   90 |     }
      |     ^
Language: C

#include<stdio.h>

int main(){
	int i;
	int n;
	int old;
	int und = 0;
	int a[7] = 0, 0, 0, 0, 0, 0, 0;
	
	while(n != 0){
		scanf("%d", &n);
			for(i = n + 1; i > 0; i--){
				scanf("%d", &old);
			    if(old < 10){
					a[0]++;
				}else if(old < 20){
				    a[1]++;
				}else if(old < 30){
				    a[2]++;
				}else if(old < 40){
				    a[3]++;
				}else if(old < 50){
				    a[4]++;
				}else if(old < 60){
					a[5]++;
				}else{
			        a[6]++;
		        }
			}
		printf("%d\n", a[0]);
		printf("%d\n", a[1]);
		printf("%d\n", a[2]);
		printf("%d\n", a[3]);
		printf("%d\n", a[4]);
		printf("%d\n", a[5]);
		printf("%d\n", a[6]);
	}
	
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:8:20: error: invalid initializer
    8 |         int a[7] = 0, 0, 0, 0, 0, 0, 0;
      |                    ^
main.c:8:23: error: expected identifier or '(' before numeric constant
    8 |         int a[7] = 0, 0, 0, 0, 0, 0, 0;
      |                       ^
Language: C

#include<stdio.h>

int main(){
	int i;
	int n;
	int old;
	int a[7] = 0, 0, 0, 0, 0, 0, 0;
	
	while(n != 0){
		scanf("%d", &n);
			for(i = n + 1; i > 0; i--){
				scanf("%d", &old);
			    if(old < 10){
					a[0]++;
				}else if(old < 20){
				    a[1]++;
				}else if(old < 30){
				    a[2]++;
				}else if(old < 40){
				    a[3]++;
				}else if(old < 50){
				    a[4]++;
				}else if(old < 60){
					a[5]++;
				}else{
			        a[6]++;
		        }
			}
		printf("%d\n", a[0]);
		printf("%d\n", a[1]);
		printf("%d\n", a[2]);
		printf("%d\n", a[3]);
		printf("%d\n", a[4]);
		printf("%d\n", a[5]);
		printf("%d\n", a[6]);
	}
	
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:20: error: invalid initializer
    7 |         int a[7] = 0, 0, 0, 0, 0, 0, 0;
      |                    ^
main.c:7:23: error: expected identifier or '(' before numeric constant
    7 |         int a[7] = 0, 0, 0, 0, 0, 0, 0;
      |                       ^
Language: C++

#incude<stdio.h>

int main(){
int n[8]={};
int N,x;

while(1){
scanf("%d",&N);if(N==0)break;

for(int i=0;i<N;i++)
{
scanf("%d",&x);
if(x<10)n[0]++;
else if(x<20)n[1]++;
else if(x<30)n[2]++;
else if(x<40)n[3]++;
else if(x<50)n[4]++;
else if(x<60)n[5]++;
else if(x>=60)n[6]++;
}
for(int i=0;i<7;i++)
printf("%d\n",n[i]);
}
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude<stdio.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:1: error: 'scanf' was not declared in this scope
    8 | scanf("%d",&N);if(N==0)break;
      | ^~~~~
a.cc:22:1: error: 'printf' was not declared in this scope
   22 | printf("%d\n",n[i]);
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #incude<stdio.h>
Language: C++

using System;

class Program {
    static void Main() {
        for (string line; (line = Console.ReadLine()) != "0";) {
            var n = int.Parse(line);
            var ages = new int[7];

            for (var i = 0; i < n; i++) {
                var age = int.Parse(Console.ReadLine());
                ages[age >= 60 ? 6 : (age / 10)] ++;
            }

            foreach (var count in ages) {
                Console.WriteLine(count);
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:19:2: error: expected ';' after class definition
   19 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:5:14: error: 'string' was not declared in this scope
    5 |         for (string line; (line = Console.ReadLine()) != "0";) {
      |              ^~~~~~
a.cc:5:28: error: 'line' was not declared in this scope
    5 |         for (string line; (line = Console.ReadLine()) != "0";) {
      |                            ^~~~
a.cc:5:35: error: 'Console' was not declared in this scope
    5 |         for (string line; (line = Console.ReadLine()) != "0";) {
      |                                   ^~~~~~~
a.cc:6:13: error: 'var' was not declared in this scope
    6 |             var n = int.Parse(line);
      |             ^~~
a.cc:7:17: error: expected ';' before 'ages'
    7 |             var ages = new int[7];
      |                 ^~~~
a.cc:9:22: error: expected ';' before 'i'
    9 |             for (var i = 0; i < n; i++) {
      |                      ^
a.cc:9:29: error: 'i' was not declared in this scope
    9 |             for (var i = 0; i < n; i++) {
      |                             ^
a.cc:9:33: error: 'n' was not declared in this scope
    9 |             for (var i = 0; i < n; i++) {
      |                                 ^
a.cc:10:21: error: expected ';' before 'age'
   10 |                 var age = int.Parse(Console.ReadLine());
      |                     ^~~
a.cc:11:17: error: 'ages' was not declared in this scope
   11 |                 ages[age >= 60 ? 6 : (age / 10)] ++;
      |                 ^~~~
a.cc:11:22: error: 'age' was not declared in this scope
   11 |                 ages[age >= 60 ? 6 : (age / 10)] ++;
      |                      ^~~
a.cc:14:26: error: expected ')' before 'count'
   14 |             foreach (var count in ages) {
      |                          ^~~~~
a.cc:14:21: note: to match this '('
   14 |             foreach (var count in ages) {
      |                     ^
a.cc:14:13: error: 'foreach' was not declared in this scope
   14 |             foreach (var count in ages) {
      |             ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <string>
#include <string.h>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	for (int u = 0; u < 100; u++)
	{
	long n;
	cin >> n;
	int a[10000],pp = 0;

	for (long i = 0; i < n; i++)
	{
		cin >> a[i];
		if (a[i] == 0)
		{
			pp = -1;
		}
	}
	
	if (pp != 0)
	{
		break;
	}

	int o = 0,p = 0,q = 0,r = 0,s = 0,t = 0,u = 0;

	for (long i = 0; i < n; i++)
	{
		if (a[i] < 10)
		{
			o++;
		}
		else if (a[i] < 20)
		{
			p++;
		}
		else if (a[i] < 30)
		{
			q++;
		}
		else if (a[i] < 40)
		{
			r++;
		}
		else if (a[i] < 50)
		{
			t++;
		}
		else
		{
			u++;
		}

		cout << o << endl << p << endl << q << endl << r << endl << s << endl << t << endl << u << endl ;
	}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:49: error: redeclaration of 'int u'
   37 |         int o = 0,p = 0,q = 0,r = 0,s = 0,t = 0,u = 0;
      |                                                 ^
a.cc:17:18: note: 'int u' previously declared here
   17 |         for (int u = 0; u < 100; u++)
      |                  ^
Language: C++

#include<iostream>
int main() {
  int am[7]={0,0,0,0,0,0,0};
  int i,k;
  while(1) {
    std::cin>>i;
    if(i==0)break;
    for(int j=0;j<i;j++) {
      std::cin>>k;
      if(k>60)k=60;
      am[k/10]++;
    }
    for(i=0;i<7;i++) std::coutam[i]<<"\n",am[i]=0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: 'coutam' is not a member of 'std'; did you mean 'cout'?
   13 |     for(i=0;i<7;i++) std::coutam[i]<<"\n",am[i]=0;
      |                           ^~~~~~
      |                           cout
Language: C++

#include <stdio.h>

int main(void)
{
int data[7] = {0};
int n;
int d;

scanf("%d", &n);

for (int i = 0; i < n; i++){
scanf("%d", &d);

if (d >= 60){
data[6]++;
}
else {
data[d / 10]++;
}

for (int i = 0; i < 7; i++){
printf("%d\n", data[i]);
}

return (0);
}

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

#include<iostream>
using namespace std;

int m,n;
int p[7]

int main(){
	cin >> n;
	if(!n)
		return 0;
	for(int i=0; i<7; i++)
		p[i] = 0;
	for(int i=0; i<n; i++){
		cin >> m;
		if(m>=70)
			m = 60;
		p[m%10]++;
	}
	for(int i=0; i<7; i++)
		cout << p[i] << endl;
}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int main(){
      | ^~~
Language: C++

while true do
  n = gets.to_i
  break if n == 0

  people_num = [ 0, 0, 0, 0, 0, 0, 0, ]
  n.times do 
    age = gets.to_i
    if age < 10 then
      people_num[0] += 1
    elsif age < 20 then
      people_num[1] += 1
    elsif age < 30 then
      people_num[2] += 1
    elsif age < 40 then
      people_num[3] += 1
    elsif age < 50 then
      people_num[4] += 1
    elsif age < 60 then
      people_num[5] += 1
    else
      people_num[6] += 1
    end
  end
  people_num.each do |n|
    puts n
  end
end

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while true do
      | ^~~~~
Language: C++

#include <iostream>
int main() {int n, x;while(std::cin>>n,n){int dat[7]={};for(int i=0;i<n;i++){cin>>x;if(x/10>6)x=60;dat[x/10]++;}for(int i=0;i<7;i++)std::cout<<dat[i]<<'\n';}}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:78: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    2 | int main() {int n, x;while(std::cin>>n,n){int dat[7]={};for(int i=0;i<n;i++){cin>>x;if(x/10>6)x=60;dat[x/10]++;}for(int i=0;i<7;i++)std::cout<<dat[i]<<'\n';}}
      |                                                                              ^~~
      |                                                                              std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: Java

import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] pri = new int[1000002];
		for(int i=2;i<=1000000;i++){
			pri[i] = i;
		}
		for(int i=2;i<=1000000;i++){
			for(int j=i+i;j<=1000000;j+=i){
					pri[j]=0;
			}
		}

		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			int count=0;
			
			for(int i=0;i<=n/2;i++){
				if(pri[i]!=0 && pri[n-i]!=0)count++;
			}
			System.out.println(count);
			

		}
	}
	

Compiler output:
Main.java:30: error: reached end of file while parsing
	}
	 ^
1 error
Language: C

#include <stdio.h>

int a[1000000];
int ans[500]

int main(void)
{
  int n, i, j, s = 0;
  
  for (i = 1; i < 10000000; i++){
    for (i = 2; i * j < 10000000; j++){
      a[i * j] = 1;
    }
  }

  while(scanf("%d", &n) != 0){
    for (i = 1; i < 10000000; i++){
      for(j = 10000000; j > 0; j--){
        if (a[i] + a[j] == n){
          ans[s]++;
        }
      }
    }
    s++;
  }

  for (i = 0; i =< s; i++){
    printf("%d\n", ans[i]);
  }

  return (0);
}

Compiler output:
main.c:4:13: error: expected ';' before 'int'
    4 | int ans[500]
      |             ^
      |             ;
    5 | 
    6 | int main(void)
      | ~~~          
main.c: In function 'main':
main.c:20:11: error: 'ans' undeclared (first use in this function)
   20 |           ans[s]++;
      |           ^~~
main.c:20:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:18: error: expected expression before '<' token
   27 |   for (i = 0; i =< s; i++){
      |                  ^
Language: C

???#include<stdio.h>
#include<math.h>
int main(){
  int n,p,q,i,j,count=0;
//  FILE *fo;

//  fo=fopen("data.txt","r");
//  fscanf(fo,"%d",&n);
  scanf("%d",&n);
  while(n<>0){
  for(p=1;p<=(n/2);p++){
    q=n-p;
    for(i=p/2;i>=2;i--)
      if(p % i== 0)break;

    if(i==1){
      for(j=q/2;j>=2;j--)
        if(q % j== 0)break;
      if(j==1){
//      printf("%d %d\n",p,q);
        count++;
      }
    }
  }

  printf("%d\n",count);
  scanf("%d",&n);
  }
   
  return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before '?' token
    1 | ???#include<stdio.h>
      | ^
main.c:1:4: error: stray '#' in program
    1 | ???#include<stdio.h>
      |    ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |   scanf("%d",&n);
      |   ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<math.h>
  +++ |+#include <stdio.h>
    3 | int main(){
main.c:9:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |   scanf("%d",&n);
      |   ^~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:11: error: expected expression before '>' token
   10 |   while(n<>0){
      |           ^
main.c:26:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |   printf("%d\n",count);
      |   ^~~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

???#include<stdio.h>
int main(){
  int n,p,q,i,j,count=0;
//  FILE *fo;

//  fo=fopen("data.txt","r");
//  fscanf(fo,"%d",&n);
  scanf("%d",&n);
  while(n!=0){
  for(p=1;p<=(n/2);p++){
    q=n-p;
    for(i=p/2;i>=2;i--)
      if(p % i== 0)break;

    if(i==1){
      for(j=q/2;j>=2;j--)
        if(q % j== 0)break;
      if(j==1){
//      printf("%d %d\n",p,q);
        count++;
      }
    }
  }

  printf("%d\n",count);
  scanf("%d",&n);
  }
   
  return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before '?' token
    1 | ???#include<stdio.h>
      | ^
main.c:1:4: error: stray '#' in program
    1 | ???#include<stdio.h>
      |    ^
Language: C

???#include<stdio.h>
#include<math.h>
int main(){
  int n,p,q,i,j,count=0;
//  FILE *fo;

//  fo=fopen("data.txt","r");
//  fscanf(fo,"%d",&n);
  scanf("%d",&n);
  while(n!=0){
  for(p=1;p<=(n/2);p++){
    q=n-p;
    for(i=p/2;i>=2;i--)
      if(p % i== 0)break;

    if(i==1){
      for(j=q/2;j>=2;j--)
        if(q % j== 0)break;
      if(j==1){
//      printf("%d %d\n",p,q);
        count++;
      }
    }
  }

  printf("%d\n",count);
  scanf("%d",&n);
  count=0;
  }
   
  return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before '?' token
    1 | ???#include<stdio.h>
      | ^
main.c:1:4: error: stray '#' in program
    1 | ???#include<stdio.h>
      |    ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |   scanf("%d",&n);
      |   ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<math.h>
  +++ |+#include <stdio.h>
    3 | int main(){
main.c:9:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |   scanf("%d",&n);
      |   ^~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:26:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |   printf("%d\n",count);
      |   ^~~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<math.h>
#define N 1000000
int prime[N];
int main(){
	int i,n,c,j;for(i=0;i<N;i++)prime[i]=1;
	prime[0] = prime[1] = 0;
	for(i=4;i<N;i+=2)prime[i]=0;
	for(i=3;i<N;i+=2){
		if(prime[i] == 0 )continue;
		for(j=i+i;j<N;j+=i)prime[j]=0;
	}
	for(;scanf("%d",&n)&&n;){c=0;for(i=0;i<=n/2;i++){if(prime[i]&&prime[n-i])c++;}printf("%d\n",count);}return 0;}

Compiler output:
main.c: In function 'main':
main.c:13:101: error: 'count' undeclared (first use in this function)
   13 |         for(;scanf("%d",&n)&&n;){c=0;for(i=0;i<=n/2;i++){if(prime[i]&&prime[n-i])c++;}printf("%d\n",count);}return 0;}
      |                                                                                                     ^~~~~
main.c:13:101: note: each undeclared identifier is reported only once for each function it appears in