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

#include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
#include <string>
#include <queue>
using namespace std;
typedef pair<string, int> P;

struct edge{
    string str;
    int to;
};

vector<edge> G[40];
vector<edge> rG[40];
vector<int> vs;
bool used[40];
int cmp[40];
int n;

void add_edge(int from, int to, string& str){
    G[from].push_back((edge){str,to});
    rG[to].push_back((edge){str,from});
}

void dfs(int v){
    used[v]=true;
    for(int i=0;i<G[v].size();i++){
        if(!used[G[v][i].to]) dfs(G[v][i].to);
    }
}

void rdfs(int v,int k){
    used[v]=true;
    cmp[v]=k;
    for(int i=0;i<rG[v].size();i++){
        if(!used[rG[v][i].to])rdfs(rG[v][i].to,k);
    }
}

int succ(){
    memset(used,0,sizeof(used));
    vs.clear();
    for(int v=0;v<n;v++){
        if(!used[v])dfs(v);
    }
    memset(used,0,sizeof(used));
    int k=0;
    for(int i=vs.size()-1;i>=0;i--){
        if(!used[vs[i]]) rdfs(vs[i],k++);
    }
    return k;
}

int main(){
    int a, s, g;
    while(cin >> n >> a >> s >> g, n){

        for(int i=0;i<n;i++){
            G[i].clear();
            rG[i].clear();
        }

        for(int i=0;i<a;i++){
            string str;
            int x, y;
            cin >> x >> y >> str;
            add_edge(x, y, str);
        }
        succ();

        for(int i=0;i<n;i++){
            if(G[i].size()==0) continue;
            string min_str = "-";
            int min_j = -1;
            for(int j=0;j<G[i].size();j++){
                if(cmp[G[i][j].to] == cmp[i]){
                    if(min_str=="-" || min_str > G[i][j].str){
                        min_str = G[i][j].str;
                    }
                }
            }
            if(min_str == "-")continue;
            for(int j=0;j<G[i].size();j++){
                if(min_str < G[i][j].str){
                    G[i].erase(G[i].begin()+j);
                    j--;
                }
            }
        }


        priority_queue<P> que;
        vector<string> d(n, "-");
        d[s] = "";
        que.push(P("", s));
        while(que.size()){
            P p = que.top(); que.pop();
            int pn = p.second;
            string& ps = p.first;
            if(d[pn]!="-"&&d[pn]<ps) continue;
            if(pn == g){
                break;
            }
            for(int i=0;i<G[pn].size();i++){
                int nn = G[pn][i].to;
                string ns = ps + G[pn][i].str;
                if(d[nn]=="-" || d[nn] > ns){
                    d[nn] = ns;
                    que.push(P(ns, nn));
                }
            }
        }
        if(d[g] == "-") cout << "NO" << endl;
        else cout << d[g] << endl;

    }
    return 0;
}

Compiler output:
a.cc: In function 'int succ()':
a.cc:43:5: error: 'memset' was not declared in this scope
   43 |     memset(used,0,sizeof(used));
      |     ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <queue>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <functional>

using namespace std;

typedef pair<string, vector<int> > SI;

string solve(int n, int s, int g, vector<int> &x, vector<int> &y, vector<string> &lab) {
	if (s == g) {
		return "";
	}
	map<string, int> e[50];
	for (int i = 0; i != x.size(); ++i) {
		map<string, int> &m = e[x[i]];
		if (m.find(lab[i]) == m.end() || m[lab[i]] == x[i]) {
			m[lab[i]] = y[i];
		}
	}
	priority_queue<SI, vector<SI>, greater<SI> > q;
	q.push(SI("", { s }));
	string ans;
	while (q.size()) {
		SI t = q.top();
		q.pop();
		int pos = find(t.second.begin(), t.second.end(), t.second.back()) - t.second.begin();
		if (pos < t.second.size() - 1) {
			if (ans.empty() || t.first < ans) {
				return "NO";
			}
			continue;
		}
		if (t.second.back() == g) {
			if (ans.empty() || t.first < ans) {
				ans = t.first;
			}
		}
		map<string, int> &m = e[t.second.back()];
		if (!m.empty()) {
			for (auto &kv : m) {
				string ns = t.first + kv.first;
				vector<int> nv = t.second;
				nv.push_back(kv.second);
				q.push(SI(ns, nv));
			}
		}
	}
	return ans.empty() ? "NO" : ans;
}

int main(int argc, char *argv[]) {
	while (true) {
		int n, a, s, g;
		cin >> n >> a >> s >> g;
		if (!n) {
			break;
		}
		vector<int> x(a), y(a);
		vector<string> lab(a);
		for (int i = 0; i < a; ++i) {
			cin >> x[i] >> y[i] >> lab[i];
		}
		cout << solve(n, s, g, x, y, lab) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'std::string solve(int, int, int, std::vector<int>&, std::vector<int>&, std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:30:31: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   30 |                 int pos = find(t.second.begin(), t.second.end(), t.second.back()) - t.second.begin();
      |                           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:30:31: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   30 |                 int pos = find(t.second.begin(), t.second.end(), t.second.back()) - t.second.begin();
      |                           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
/*
*/

using namespace std;


typedef pair<string, pair<long long int, unsigned long long int>>status;

int main() {
	long long int n, a, s, g;
	while( cin >> n >> a >> s >> g, n || a || s || g ) {
		vector<vector<pair<string, long long int>>>D( n );
		for( size_t i = 0; i < a; i++ ) {
			long long int x, y;
			string lab;
			cin >> x >> y >> lab;
			D[x].push_back( make_pair( lab, y ) );
		}
		for( size_t i = 0; i < n; i++ ) {
			sort( D[i].begin(), D[i].end() );
		}
		//priority_queue<status, set<status>, greater<status>>que;
		set<status>que;
		unsigned long long int init = 1ULL << s;
		que.insert( make_pair( "", make_pair( s, init ) ) );
		vector<string>limitdata( n, "" );
		string ans = "NO";
		limitdata[s] = "";
		while( que.size() ) {
			auto now = *que.begin(); que.erase( now );
			if( loop < now.first ) {
				break;
			}
			if( now.second.first == g ) {
				ans = now.first;
				break;
			}
			for( auto x : D[now.second.first] ) {
				if( ( ( now.second.second >> x.second ) ^ 1ULL ) ) {
					auto next = now;
					if( x.first.length() + next.first.length() < 300 ) {
						next.first += x.first;
						if( loop > next.first && ( next.first <= limitdata[x.second] || limitdata[x.second] == "" ) ) {
							limitdata[x.second] = next.first;
							next.second.first = x.second;
							next.second.second |= 1ULL << x.second;
							que.insert( next );
						}
					}
				} else {
					loop = min( loop, now.first + x.first );
				}
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:29: error: 'loop' was not declared in this scope
   32 |                         if( loop < now.first ) {
      |                             ^~~~
a.cc:44:53: error: 'loop' was not declared in this scope
   44 |                                                 if( loop > next.first && ( next.first <= limitdata[x.second] || limitdata[x.second] == "" ) ) {
      |                                                     ^~~~
a.cc:52:41: error: 'loop' was not declared in this scope
   52 |                                         loop = min( loop, now.first + x.first );
      |                                         ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;

struct edge {
	int s;
	int t;
	string cost;
	edge() {}
	edge(int s, int t, string cost) :s(s), t(t), cost(cost) {}
};

int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	while (1) {
		int n, a, s, g;
		cin >> n >> a >> s >> g;
		if (n == 0 && a == 0 && s == 0 && g == 0) break;
		vector<vector<edge>> G(n);
		for (int i = 0; i < a;i++) {
			int x, y;
			string lab;
			cin >> x >> y >> lab;
			G[x].push_back(edge(x, y, lab));
		}

		vector<string> ans;
		//vector<bool> f(n, false);
		queue<pair<string,pair<int,int>>> q;
		q.push({ "",{s,0} });
		//f[s] = true;
		while (!q.empty()) {
			auto nex = q.front(); q.pop();
			string s = nex.first;
			int at = nex.second.first;
			int cnt = nex.second.second;

			if (G[at].size() == 0) {
				continue;
			}
			string next_s = s + G[at][0].cost;
			for (int i = 1; i < G[at].size();i++) {
				if (s + G[at][i].cost < next_s) {
					next_s = s + G[at][i].cost;
				}
			}

			//cout << next_s << endl;

			for (int i = 0; i < G[at].size();i++) {
				if (next_s == s + G[at][i].cost) {
					if (G[at][i].t != g && cnt > n) {
						continue;
					}
					if (G[at][i].t == g) {
						ans.push_back(next_s);
						continue;
					}
					q.push({ next_s,{G[at][i].t,cnt + 1} });
				}
			}
		}

		sort(ans.begin(), ans.end());

		if (ans.size() == 0) {
			cout << "NO" << endl;
		}
		else {
			cout << ans[0] << endl;
		}
	}
}

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

#include <iostream>
#include <string>
#include <vector>
#include <queue>

using namespace std;

typedef vector< vector< pair<int, string> > > Graph;

class Node{
public:
	int pos; string str; int prev;
	Node(int pos, string str, int prev) : pos(pos), str(str), prev(prev) {}
	bool operator < (const Node &nd) const { return str > nd.str; }
};

int main(){
	int n, a, s, g;
	bool con[40][40];
	bool reach[40];
	bool visit[240][40];
	string str[240][40];
	while(cin >> n >> a >> s >> g, n){
		Graph graph(n);
		memset(con, false, sizeof(con));
		memset(reach, false, sizeof(reach));
		for(int i=0;i<a;i++){
			int x, y; string lab; cin >> x >> y >> lab;
			graph[x].push_back(make_pair(y,lab));
			con[y][x] = true;
		}
		queue<int> quG; quG.push(g);
		while(!quG.empty()){
			int cur = quG.front(); quG.pop();
			if(reach[cur]) continue;
			reach[cur] = true;
			for(int i=0;i<n;i++)
				if(!reach[i]&&con[cur][i]) quG.push(i);
		}
		memset(visit, false, sizeof(visit));
		for(int i=0;i<6*n;i++)
			for(int j=0;j<n;j++) str[i][j] = "";
		priority_queue<Node> qu; qu.push(Node(s, "", -2));
		while(!qu.empty()){
			Node nd = qu.top(); qu.pop();
			int pos = nd.pos, size = nd.str.size();
			if(visit[size][pos]) continue;
			visit[size][pos] = true;
			for(int i=0;i<graph[pos].size();i++){
				int npos = graph[pos][i].first;
				if(size + graph[pos][i].second.size() >= 6*n) continue;
				string nstr = nd.str + graph[pos][i].second;
				if(str[nstr.size()][npos]==""||str[nstr.size()][npos]>nstr){
					str[nstr.size()][npos] = nstr;
					qu.push(Node(npos, nstr, size*n+pos));
				}
			}
		}
		string ans = "";
		for(int i=0;i<6*(n-1);i++){
			if(str[i][g] == "") continue;
			if(ans == ""||ans > str[i][g]) ans = str[i][g];
		}
		if(ans != ""){
			for(int i=0;i<n;i++){
				if(!reach[i]) continue;
				for(int j=6*(n-1);j<6*n;j++){
					if(str[j][i]=="") continue;
					if(str[j][i]<ans) ans = "";
				}
			}
		}
		cout << (ans!="" ? ans : "NO") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'memset' was not declared in this scope
   25 |                 memset(con, false, sizeof(con));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <queue>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef pair<string,int> P;
map<int,vector<P> >arr;
int N,S,G;

void bfs(){
	set<P>q;
	q.insert(make_pair("",S));
	for(;!q.empty();){
		P p=*q.begin();q.erase(q.begin());
		if(p.second==G){cout<<p.first<<endl;return;}
		if(p.first.length()>=N*6){cout<<"NO"<<endl;return;}
		vector<P> a=arr[p.second];
		if(!a.empty()){
			string prefix=a[0].first;
			for(int i=0;i<a.size();i++){
				if(a[i].first.substr(0,prefix.length())!=prefix)break;
				q.insert(make_pair(p.first+a[i].first,a[i].second));
			}
		}
	}
}

int r[40][40];
int main(){
	int a,i,j,k;
	map<int,vector<P> >::iterator it;
	vector<P>::iterator it2;
	for(;cin>>N>>a>>S>>G,N;){
		memset(r,0,sizeof(r));
		arr.clear();
		int _a,_b;string _s;
		for(;a;a--)cin>>_a>>_b>>_s,arr[_a].push_back(make_pair(_s,_b)),r[_a][_b]=1;
		for(k=0;k<N;k++)
			for(r[k][k]=1,i=0;i<N;i++)
				for(j=0;j<N;j++)
					r[i][j]|=r[i][k]&r[k][j];
		if(!r[S][G]){cout<<"NO"<<endl;continue;}
		for(it=arr.begin();it!=arr.end();it++){
			vector<P> &x=(*it).second;
			for(it2=x.begin();it2!=x.end();)
				if(!r[(*it2).second][G])x.erase(it2);else it2++;
			sort(x.begin(),x.end());
		}
		bfs();
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'memset' was not declared in this scope
   37 |                 memset(r,0,sizeof(r));
      |                 ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <algorithm>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

// ACM-ICPCà\I2010 E. Å­Ìô¶

#include <iostream>
#include <string>
#include <vector>
#include <queue>

using namespace std;

typedef vector< vector< pair<int, string> > > Graph;

class Node{
public:
	int pos; string str; int prev;
	Node(int pos, string str, int prev) : pos(pos), str(str), prev(prev) {}
	bool operator < (const Node &nd) const { return str > nd.str; }
};

int main(){
	int n, a, s, g;
	int prev[480][40];
	string str[480][40];
	while(cin >> n >> a >> s >> g, n){
		Graph graph(n);
		for(int i=0;i<a;i++){
			int x, y; string lab; cin >> x >> y >> lab;
			graph[x].push_back(make_pair(y,lab));
		}
		memset(prev, -1, sizeof(prev));
		for(int i=0;i<12*n;i++)
			for(int j=0;j<n;j++) str[i][j] = "";
		priority_queue<Node> qu; qu.push(Node(s, "", -2));
		while(!qu.empty()){
			Node nd = qu.top(); qu.pop();
			int pos = nd.pos, size = nd.str.size();
			if(prev[size][pos]!=-1) continue;
			prev[size][pos] = nd.prev;
			str[size][pos] = nd.str;
			for(int i=0;i<graph[pos].size();i++){
				int npos = graph[pos][i].first;
				if(size + graph[pos][i].second.size() >= 12*n) continue;
				string nstr = nd.str + graph[pos][i].second;
				if(str[nstr.size()][npos]==""||nstr<str[nstr.size()][npos]){
					str[nstr.size()][npos] = nstr;
					qu.push(Node(npos, nstr, size*n+pos));
				}
			}
		}
		int minpos = -1;
		string ans = "";
		for(int i=0;i<12*n;i++){
			if(str[i][g]=="") continue;
			if(ans == ""||ans > str[i][g]){
				ans = str[i][g];
				minpos = i;
			}
		}
		bool flag = (minpos != -1);
		bool visit[40];
		memset(visit, false, sizeof(visit));
		int cur = minpos*n+g;
		while(flag&&cur!=-2){
			if(visit[cur%n]) flag = false;
			visit[cur%n] = true;
			cur = prev[cur/n][cur%n];
		}
		cout << (flag ? ans : "NO") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'memset' was not declared in this scope
   29 |                 memset(prev, -1, sizeof(prev));
      |                 ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <queue>
  +++ |+#include <cstring>
    7 |
Language: C++


#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <string>

#include <cstdio>

using namespace std;

typedef pair<string,int> spell;

inline int cmp(const string &s1, const string &s2){
	return s1.compare( 0, s1.length(), s2, 0, s1.length() );
}

string str;
bitset<150> able;
bool pr1(const spell &sp){	return !able[sp.second];	}
bool pr2(const spell &sp){
	return cmp( str, sp.first ) != 0;
}

int main(){
	int n, a, s, g, x, y;
	for(; cin >> n >> a >> s >> g , n; able.reset() ){
		vector<list<spell> > vec(n);
		vector<vector<int> > vec_b(n);
		for(int i = 0; i < a; i++){
			cin >> x >> y >> str;

			vec[x].push_back( spell(str,y) );
			vec_b[y].push_back(x);
		}
		stack<int> st;
		for(st.push(g); !st.empty(); ){
			int p = st.top();
			st.pop();
			able[p] = true;
			for(
				vector<int>::iterator it = vec_b[p].begin();
				it != vec_b[p].end();
				++it
			){
				if(!able[*it]) st.push(*it);
			}
		}
		vec_b.clear();
		
		if( !able[s] ){
			cout << "NO\n";
			continue;
		}
		
		for(int i = 0; i < n; i++ ){
			vec[i].remove_if(pr1);
			if( !vec[i].empty() ){
				vec[i].sort();
				str = vec[i].front().first;
				vec[i].remove_if(pr2);
			}
		}

		string best = "~";

		typedef priority_queue<spell,vector<spell>,greater<spell> > prq;
		prq qu[2];
		qu[0].push( spell("",s) );

		for(;;){
			int t = cnt & 1;
			if( qu[t].empty() ){
				break;
			}

			str = qu[t].top().first;
			if( str >= best ){	break;	}
			for( spell sp; !qu[t].empty(); ){
				sp = qu[t].top();
				qu[t].pop();
				if( cmp( str, sp.first ) ){
					qu[t] = prq();
				}
				else{
					for(
						list<spell>::iterator it = vec[sp.second].begin();
						it != vec[sp.second].end();
						++it
					){
						string newst = sp.first + it->first;
						if( it->second == g ){
							if( newst < best )best = newst;
						}
						else if( sp.second != it->second ){
							qu[!t].push( spell( newst, it->second ) );
						}
					}
				}
			}
		}
		if( best == "~" ){	cout << "NO\n";	}
		else{	cout << best << endl;	}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
   76 |                         int t = cnt & 1;
      |                                 ^~~
      |                                 int
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>

using namespace std;


typedef pair<string, int> P;

multimap <int, string> road[41];
set < P,less<P> > dp;

int reachable[41][41];

main(){
	int n,a,s,g,i,j,k;
	map<int, string>::iterator it;
	while(cin>>n>>a>>s>>g,n){
		memset(reachable, 0, sizeof(reachable));
		while(a--){
			int x, y;
			string lab;
			cin>>x>>y>>lab;
			road[x].insert(make_pair(y, lab));
			reachable[x][y]=1;
		}
		
		for(k=0;k<n;k++){
			reachable[k][k]=1;
			for(i=0;i<n;i++)
				for(j=0;j<n;j++)
					reachable[i][j] |= reachable[i][k] && reachable[k][j];
		}

		dp.insert( make_pair("", s) );
		string lab;
		while(s!=g){
			if(dp.empty()) break;
			s = dp.begin()->second;
			lab = dp.begin()->first;
			dp.erase(dp.begin());
			if(lab.size()>6*n) break;

			for(it=road[s].begin();it!=road[s].end();it++){
				if(!reachable[it->first][g]) continue;
				dp.insert( make_pair(lab+it->second, it->first) );
			}
		}
		if(s==g) cout << lab << endl;
		else cout << "NO" << endl;
		dp.clear();
		for(i=0;i<n;i++) road[i].clear();
	}
}

Compiler output:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:21:17: error: 'memset' was not declared in this scope
   21 |                 memset(reachable, 0, sizeof(reachable));
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <set>
  +++ |+#include <cstring>
    6 |
Language: Java

import java.util.Scanner;

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

		boolean[] E=new boolean[123456];
		for(int a=2;a<123456;a++) E[a]=true;
		for(int a=2;a<1000;a++) if(E[a]) for(int b=a*a;b<123456;b+=a) E[b]=false;

		while(true){
			int n=sc.nextInt();
			if(n==0) break;
			int ans=0;
			for(int a=n+1;a<=2*n;i++) if(E[a]) ans++;
			System.out.println(ans);
		}

		return;
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
			for(int a=n+1;a<=2*n;i++) if(E[a]) ans++;
			                     ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Chebyshevs_Theorem {
        public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (true) {
            int n = scan.nextInt();
            if(n==0){
                break;
            }
            sosuu(n);
        }
    }
    public static void sosuu(int n){
        int a=0;
        int b=0;
        for (int i =n+1; i <=2*n ; i++) {
            for (int j = 2; j <=i ; j++) {
                if (i %j == 0) {
                    a++;
                }
            }
                if(a==1){
                    b++;
                }
          a=0;
        }
        System.out.println(b);
    }
}

Compiler output:
Main.java:3: error: class Chebyshevs_Theorem is public, should be declared in a file named Chebyshevs_Theorem.java
public class Chebyshevs_Theorem {
       ^
1 error
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args) {
		Scanner scn=new Scanner(System.in);
		int n;
		//List<Integer> dat=new ArrayList<Integer>();
		while(true){
			int ans=0;
			n=scn.nextInt();
			if(n==0)break;

			for(int i=n+1;i<=2*n;i++){
				for(int j=2;j<=i;j++){
					if(i%j==0)break;
					if(j>=i/2){
						ans++;
						break;
					}

				}
			}
			//dat.add(ans);
		}
		//for(int i=0;i<dat.size();i++){
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:28: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args) {
		Scanner scn=new Scanner(System.in);
		int n;
		//List<Integer> dat=new ArrayList<Integer>();
		while(true){
			int ans=0;
			n=scn.nextInt();
			if(n==0)break;

			for(int i=n+1;i<=2*n;i++){
				for(int j=2;j<=i;j++){
					if(i%j==0)break;
					if(j>=i/2){
						ans++;
						break;
					}

				}
			}
			//dat.add(ans);
		}
		//for(int i=0;i<dat.size();i++){
			System.out.println(ans);
		//}
	}
}

Compiler output:
Main.java:25: error: cannot find symbol
			System.out.println(ans);
			                   ^
  symbol:   variable ans
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;

			int number = n - 1;

			for (int k = n + 1; k <= (2 * n) - 1; k++) {
				for (int d = 2; d <= n; d++) {
					if (k % d == 0) {
						number--;
						break;
					}
				}

			}
			System.out.println(number);
		}

	}

}



Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int count = 0;
			for (int i = n + 1; i <= 2 * n; i++) {
				int num = (int) Math.sqrt(i) + 1;
				if (i == 2)
					num = 2;
				int yaku_count = 0;
				for (int j = 1; j < num; j++) {
					// System.out.println(num);
					if (i % j == 0)
						yaku_count += 2;
				}
				if (yaku_count % num == 0) {
					yaku_count += 1;
				}
				if (i == 2)
					yaku_count -= 1;
				if (yaku_count == 2) {
					count += 1;
					// System.out.println("i =" + i);
				}
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.ArrayList;
import java.util.Scanner;


public class Main{

	Scanner sc=new Scanner(System.in);
	static final int upperlimit=2*123456;
	
	private void cal(){
		
		ArrayList<Integer> primes=new ArrayList<Integer>();
		
		primes.add(2);

		for(int i=3;i<chebyshev.upperlimit;i+=2){
			for(int j=0;j<primes.size();j++){
				if(i%primes.get(j)==0)
					break;
				if(j==primes.size()-1)
					primes.add(i);
			}
		}
	
		
		
		while(true){
			int n=sc.nextInt();
			int count=0;
			
			if(n==0)
				break;
			
			for(int i=0;i<primes.size();i++){
				int prime=primes.get(i);
				if(prime>2*n)
					break;
				else if(prime<=n)
					continue;
				else count++;
				
			}
			System.out.println(count);
						
		}
		
		
	}
	
	public static void main(String[] argv){
		new Main().cal();
	}
	
}

Compiler output:
Main.java:16: error: cannot find symbol
		for(int i=3;i<chebyshev.upperlimit;i+=2){
		              ^
  symbol:   variable chebyshev
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.*;

public class icpc2011a {
    public static void main(String args[]) {
	Scanner sc = new Scanner(System.in);

	while (true) {
	    int n = sc.nextInt();
	    int ans = 0;
	    if (n == 0) {
		break;
	    }
	    
	    ans = solve(n);
	    System.out.println(ans);
	}
    }

    public static int solve(int n) {
	//int max = 123456 * 2;
	//int prime[] = new prime[123456 * 2 + 1];
	boolean is_prime[] = new boolean[123456 * 2 + 1];
	int count = 0;

	//int p = 0;
	for (int i = 0; i <= 2 * n; i++) {
	    is_prime[i] = true;
	}

	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i <= 2 * n; i++) {
	    if (is_prime[i]) {
		// prime[p++] = i;
		for (int j = 2 * i; j <= 2 * n; j += i) {
		    is_prime[j] = false;
		}
	    }
	}
	for (int i = n + 1; i <= 2 * n; i++) {
	    if (is_prime[i]) {
		count++;
	    }
	}
	
	return count;
    }
}

Compiler output:
Main.java:4: error: class icpc2011a is public, should be declared in a file named icpc2011a.java
public class icpc2011a {
       ^
1 error
Language: Java

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


public class A2011 {
	
	public static final int MAX = 123456;
	
	public static void main(String[] args) {
		boolean[] is_prime = new boolean[MAX * 2 + 1];
		
		Arrays.fill(is_prime, true);
		is_prime[0] = is_prime[1] = false;
		
		for(int i = 0; i <= MAX * 2; i++){
			if(is_prime[i]){
				for(int j = 2 * i; j <= MAX * 2; j += i){
					is_prime[j] = false;
				}
			}
		}
		
		int[] count = new int[MAX * 2 + 1];
		
		for(int i = 0; i <= MAX * 2; i++){
			if(is_prime[i]){
				count[i] = 1;
			}
		}
		
		for(int i = 1; i <= MAX * 2; i++){
			count[i] += count[i-1];
		}
		
		Scanner sc = new Scanner(System.in);
		
		while(true){
			final int n = sc.nextInt();
			
			if(n == 0){
				break;
			}
			
			System.out.println(count[2*n] - count[n]);
		}
		
		sc.close();
	}

}

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

import java.util.Scanner;
import java.util.HashSet;
import java.util.ArrayList;

public class ChebyshevesTheorem {
	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		while(stdin.hasNext()){
			int n = stdin.nextInt();
			if (n == 0) break;
			System.out.println(primeNumberNums(n));
		}
		System.exit(0);
	}
	public static int primeNumberNums(int n){
		HashSet<Integer> checked = new HashSet<Integer>();
		ArrayList<Integer> primenums = new ArrayList<Integer>();
		for (int i = 2; i <= n; i++){
			int j = 1;
			int k;
			while((k = i * j) <= n * 2){
				checked.add(k);
				j++;
			}
		}
		for (int i = n; i <= 2 * n; i++) {
			if (! checked.contains(i)){
				primenums.add(i);
			}
		}
		return primenums.size();
	}
}

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

import java.util.Scanner;



public class main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner sc=new Scanner(System.in);

		while(true){

			int n=sc.nextInt();

			if(n==0)

				break;

			int cnt=0,flag;

			for(int i=n+1;i<=2*n;i++){

				flag=0;

				for(int j=2;j<i;j++){

					if(i%j==0){

						flag=1;

						break;

					}

				}

				if(flag==0)

					cnt++;

			}
			
			System.out.println(cnt);

		}

	}

}

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

package main;

import java.util.Scanner;



public class main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner sc=new Scanner(System.in);

		while(true){

			int n=sc.nextInt();

			if(n==0)

				break;

			int cnt=0,flag;

			for(int i=n+1;i<=2*n;i++){

				flag=0;

				for(int j=2;j<i;j++){

					if(i%j==0){

						flag=1;

						break;

					}

				}

				if(flag==0)

					cnt++;

			}
			
			System.out.println(cnt);

		}

	}

}

Compiler output:
Main.java:7: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java


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

/**
 * @author kumar1
 *
 */
public class ProblemA {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		try {
			solve();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
	}

	/**
	 * @throws IOException 
	 * 
	 */
	private static void solve() throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		//File file = new File("case.txt");
		ArrayList<Integer> list = new ArrayList<Integer>();
		BufferedReader in = new	BufferedReader(new InputStreamReader(System.in));
		String s;
		while((s = in.readLine()) != null) {
			Scanner scan = new Scanner(s);
			int n = 0;
			while(scan.hasNextInt()) {
				n = scan.nextInt();
				list.add(n);
			}
			scan.close();
			if(n == 0)
				break;
		}
		in.close();
		//System.out.println(list);
		int max = 0;
		for(int x : list) {
			if(max < x) {
				max = x;
			}
		}
		
		// max * 2までの篩をつくる
		boolean[] arr = new boolean[max * 2 + 1];
		arr[0] = true;
		for(int i = 2; i < arr.length; i++) {
			if(arr[i] == true)
				continue;
			for(int j = 2; i * j < arr.length; j++) {
				arr[i * j] = true;
			}
		}
		//System.out.println("unko");
		
		// 個数を得る
		int[] ans = new int[list.size() - 1];
		for(int i=0; i < ans.length; i++) {
			ans[i] = getPrimeNum(arr, list.get(i) + 1, list.get(i) * 2);
		}
		
		// 出力
		for(int i=0; i < ans.length; i++) {
			System.out.println(ans[i]);
		}
	}

	/**
	 * @param arr
	 * @param i
	 * @param j
	 * @return
	 */
	private static int getPrimeNum(boolean[] arr, int i, int j) {
		// TODO 自動生成されたメソッド・スタブ
		int ret = 0;
		for(int k = i; k <= j; k++) {
			if(arr[k] == false) {
				ret++;
			}
		}
		return ret;
	}
	
	
	

}

Compiler output:
Main.java:12: error: class ProblemA is public, should be declared in a file named ProblemA.java
public class ProblemA {
       ^
1 error
Language: Java

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


public class A {
	
	public static void initSieve(int n, byte[] sieve) {
		for (int i = 2; i < n; i++) {
	    	if (sieve[i] == 0) {
	    		sieve[i] = 1;
	    		for (int j = 2 * i; j < sieve.length; j += i) {
	    			sieve[j] = -1;
	    		}
	    	}
		}
	}
	
	public static boolean isPrime(int n, byte[] sieve) {
		if (n < 2) return false;
	    return sieve[n] == 1;
	}
	
	public static int solve(int n) {
		if (n < 1) return 0;
		
		byte[] sieve = new byte[2 * n + 1];
		initSieve(2 * n, sieve);
		int count = 0;
		for (int i = n + 1; i <= 2 * n; i++) {
	        if (isPrime(i, sieve)) {
	        	count++;
	        }
		}
		return count;
	}

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
		String output = "";
		String line;
		while ((line = r.readLine()) != null) {
			int n = Integer.parseInt(line);
			if (n == 0) {
				break;
			} else {
				output += solve(n) + "\n";
			}
		}
		System.out.println(output);
	}
	
}

Compiler output:
Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

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


public class A {

	public static final int MAX = 123456 * 2;
	public static final int SQT = (int) Math.ceil(Math.sqrt(MAX));
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] sums = new int[MAX + 1];
		Arrays.fill(sums, 1);
		sums[0] = sums[1] = 0;
		
		for(int i = 2; i <= MAX; i++){
			if(sums[i] > 0){
				for(int j = i * 2; j <= MAX; j += i){
					sums[j] = 0;
				}
			}
		}
		
		for(int i = 1; i <= MAX; i++){
			sums[i] += sums[i-1];
		}
		
		while(true){
			final int n = sc.nextInt();
			
			if(n == 0){
				break;
			}
			
			System.out.println(sums[2 * n] - sums[n]);
		}

	}

}

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

mport java.util.*;
import java.math.BigInteger;
class Main{
    public static void main (String[] args){
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	while(n > 0){
	    int count = 0;
	    for(int i=n;i<2*n;i++){
	        boolean isPrime = BigInteger.valueOf(i).isProbablePrime(100);
		if(isPrime) count++;
	    }
	    System.out.println(count);
	    n = sc.nextInt();
	}
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
Main.java:2: error: class, interface, enum, or record expected
import java.math.BigInteger;
^
2 errors
Language: Java

mport java.util.*;
import java.lang.Math;
class Main{
    public static void main (String[] args){
	Scanner sc = new Scanner(System.in);
	while(true) {
	    int n = sc.nextInt();
	    if (n == 0) break;
	    int count = 0;
	    for(int i=n+1;i<=2*n;i++){
	        if (isPrime(i))
		    count++;
	    }
	    System.out.println(count);
	}
    }
    static boolean isPrime(int n){
	if(n==1 || n==2)return true;
	double pow =Math.pow(n,0.5)+1;
	for(int i = 2; i<pow; i++){
	    if(n % i == 0) return false;
	}
	return true;
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
Main.java:2: error: class, interface, enum, or record expected
import java.lang.Math;
^
2 errors
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int n = 0,count = 0;
	boolean check = true;

	while(sc.hasNext()){
	    n = sc.nextInt();
	    count = 0;//テ・ツ按敕ヲツ慊淌・ツ個?
	    check = true;

	    if(n==0) break;

	    for(int i = n+1;i<=2*n;i++){
		check = true;
		for(int j = 2;j<i;j++){
		    if(i%j == 0) check = false;
		    }
		}
		if(check) count++;
	    }

	    System.out.println(count);
	}

    }
}

Compiler output:
Main.java:29: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner;

public class Main1172{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int n = 0,count = 0;
	boolean check = true;

	while(sc.hasNext()){
	    n = sc.nextInt();
	    count = 0;//テ・ツ按敕ヲツ慊淌・ツ個?
	    check = true;

	    if(n==0) break;

	    for(int i = n+1;i<=2*n;i++){
		check = true;
		for(int j = 2;j<i;j++){
		    if(i%j == 0) check = false;
		}
		
		if(check) count++;
	    }

	    System.out.println(count);
	}

    }
}

Compiler output:
Main.java:3: error: class Main1172 is public, should be declared in a file named Main1172.java
public class Main1172{
       ^
1 error
Language: C

#include <iostream>

using namespace std;

int dp[130000*2];

int main(){
	while(1){
		int n; cin >> n;
		if(!n) break;
		int count =0;
		for(int i=n+1; i<=2*n; i++){
			bool flag =true;
			for(int j=2; j<n; j++){
				if(dp[i]==1){
					count++;
					flag=false;
					break;
				}
				if(i%j==0){
					flag=false;
					break;
				}
			}
			if(flag){
				dp[i]=1;
				count++;
			}
		}
		cout << count << endl;
	} 
	return 0;


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

def get(num):
    n=0
    is_prime=[0]*200050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)



Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def get(num):
      | ^~~
main.c: In function 'get':
main.c:1:13: error: expected declaration specifiers before ':' token
    1 | def get(num):
      |             ^
main.c:21:10: error: invalid preprocessing directive #p
   21 | #        p=0
      |          ^
main.c:22:10: error: invalid preprocessing directive #for
   22 | #        for i in range(b+1,2*b+1):
      |          ^~~
main.c:23:22: error: missing binary operator before token "("
   23 | #            if(judge(i)):
      |                      ^
main.c:23: error: unterminated #if
   23 | #            if(judge(i)):
main.c:1:5: error: type of 'num' defaults to 'int' [-Wimplicit-int]
    1 | def get(num):
      |     ^~~
Language: C

#include <stdio.h>
#include <string.h>
#include <math.h>

int sosu(int n){
	int n,i;
	if(n<=1)return 0;;
	for(i=2; i<=sqrt(n)){
		if(n%i==0)return 0;
	}
	return 1;
}

int main(){
	int n,i;
	int ans;
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		for(i=n; i<=n*2; i++){
			if(sosu(i))ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

Compiler output:
main.c: In function 'sosu':
main.c:6:13: error: 'n' redeclared as different kind of symbol
    6 |         int n,i;
      |             ^
main.c:5:14: note: previous definition of 'n' with type 'int'
    5 | int sosu(int n){
      |          ~~~~^
main.c:8:28: error: expected ';' before ')' token
    8 |         for(i=2; i<=sqrt(n)){
      |                            ^
      |                            ;
Language: C


#include <stdio.h>
#include <math.h>

int main (){

	int count=0;
	int point[10000]={};
	int input = 0;
	int max=0;

	int result[1000]={};
	int prime[1000000]= {};
	int sq_num=0;
	int deli=0;
	int i=0;
	while(1){
	  scanf("%d",&input);
	  if(input == 0 ){
		break;
	  }
	  count = 0;
	  prime[2]=1;
	  i=3;
	  while(1){
		prime[i]=1;
		i++;
		prime[i]=0;
		i++;
		if( i > 1000000){
		  break;
		}
	  }
	  i=input;
	  sq_num = (int)sqrt(2*i);
	  i=2;	
	  while(1){
		if(prime[i]==1){
		  deli=i;
		  while( input*2 > deli ){
			deli += i;
			prime[deli] = 0;
		  }
		}
		i++;
		if(sq_num < i){
		  break;
		}
	  }
	  i=input;
	  i++;
	  while(1){
		if(prime[i] == 1){
		  result[count]++;
		}
		i++;
		if (2*input < i){
		  break;
		}
	  }
	  if(input == 0 ){
		break;
	  }
	  printf("%d\n",result[count]);
	  count++;
	}
	
	return 0;

Compiler output:
main.c: In function 'main':
main.c:68:9: error: expected declaration or statement at end of input
   68 |         return 0;
      |         ^~~~~~
Language: C

#include <stdio.h>
#define MAX 123456

int p[2*MAX+1];

void prime(){
int i,j;
for(i=0; i <= 2*MAX; i++) p[i] = 1;
for(i=2; i<= MAX; i++){
if(pf[i] == 0) continue;
j = i+i;
while(j <= 2*MAX){
p[j] = 0;
j += i;
}
}
}

int main(){
int n,cnt,i;

prime();
while(1){
scanf("%d", &n);
if(n == 0) break;
cnt = 0;
for(i=n+1; i <= 2*n; i++)
cnt += p[i];
printf("%d\n",cnt);
}
}

Compiler output:
main.c: In function 'prime':
main.c:10:4: error: 'pf' undeclared (first use in this function); did you mean 'p'?
   10 | if(pf[i] == 0) continue;
      |    ^~
      |    p
main.c:10:4: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define MAX 123456

bool p[2*MAX+1];

void prime(){
int i,j;
for(i=0; i <= 2*MAX; i++) p[i] = 1;
for(i=2; i<= MAX; i++){
if(p[i] == 0) continue;
j = i+i;
while(j <= 2*MAX){
p[j] = 0;
j += i;
}
}
}

int main(){
int n,cnt,i;

prime();
while(1){
scanf("%d", &n);
if(n == 0) break;
cnt = 0;
for(i=n+1; i <= 2*n; i++)
cnt += p[i];
printf("%d\n",cnt);
}
}

Compiler output:
main.c:4:1: error: unknown type name 'bool'
    4 | bool p[2*MAX+1];
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | #define MAX 123456
Language: C

#include <stdio.h>
int main(void)
{
  int n,i,j,c,f;
  while(scanf("%d",&n),n){
    c=0;
    for(i=n+1;i<=2*n;i++){
      f=1;
      for(j=2;j*j<=i;j++){
	if(!(i&j)){
	  f=0;
	  break;
	}
      }
      if(f) c++;
    }
    prinf("%d\n",c);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |     prinf("%d\n",c);
      |     ^~~~~
      |     printf
Language: C

#include <stdio.h>


 
#define MAXPRIME   
 
 
int prime[MAXPRIME + 1];
 
void make_prime(void)  //?´???°????±?????????¢??° 
{
    int i;
    int j;
    int n;
    int c;
     
    for (i = 2; i * i <= MAXPRIME; i++){
        if (prime[i] == 0){
            for (j = i * 2; j <= MAXPRIME; j += i){
                prime[j] = 1;
            }
        }
    }
}
     
 
 
int main(void)
{
    int n;
    int i;
    int count;
     
    make_prime();
 
    while (1){
        scanf("%d", &n);
        if (n == 0){
            break;
        }
         
        count = 0;
        for (i = n + 1; i <= n * 2; i++){
            if (prime[i] == 0){
                count++;
            }
        }
        printf("%d\n", count);
    }
     
    return 0;
}

Compiler output:
main.c: In function 'make_prime':
main.c:17:34: error: expected expression before ';' token
   17 |     for (i = 2; i * i <= MAXPRIME; i++){
      |                                  ^
main.c:19:42: error: expected expression before ';' token
   19 |             for (j = i * 2; j <= MAXPRIME; j += i){
      |                                          ^
Language: C

#include <stdio.h>
#include<stdlib.h>
#include <string.h> 


int main(void){
	int ans[100]={0};
	int in_a;
	int x;
	int y;
	int math[246913];
	int i;
	int j;
	int k;
	
	for(k=0;;k++){
		scanf("%d",&in_a);
		if(in_a==0){
			break;
		}
		
		for(i=in_a+1;i<=2*in_a;i++){
			x=1;
			for(j=2;j*j<i;j++){
				if(i%j==0){
					x=0;
				}
			}
			
			if(x==1){
				ans[k]++;
			}
		}
				
		
	}
	
	ans[k]=-1;
	for(i=0;ans[i]!=-1;i++){
		printf("%d\n",ans[i]);
	}

	
	return 0;
}

}

Compiler output:
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C

#include <stdio.h>

int main(void);
int cntPrimeNumber(int n);
int isPrimeNumber(int n);

int main(void) {
  int data;
  scanf("%d", &data);

  while(data != 0) {
    printf(cntPrimeNumber(data));
    scanf("%d", &data);
  }
}


int cntPrimeNumber(int n) {
  int cnt = 0;

  for (int i = n + 1; i < n * 2; i++) {
    if (isPrimeNumber(i) == 1) {
      cnt++;
    }
  }

  return cnt;
}

int isPrimeNumber(int n) {
  if ((n % 2) == 0) {
    return 0;
  }

  for (int i = 3; i < n; i += 2) {
    if ((n % i) == 0) {
      return 0;
    }
  }
  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:12:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   12 |     printf(cntPrimeNumber(data));
      |            ^~~~~~~~~~~~~~~~~~~~
      |            |
      |            int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C

#include <stdio.h>
#include <math.h>

//???????????°x??????p<=???x?????????????´???????p??????????????¨????????§???????????¨???????´???°???????????????
int isPrime(int x){
    int i;
    double rx = sqrt(x); //???x
    if(x<2) return 0; //2???????°?????????????????´???°??§?????????
    else if(x==2) return 1; //2????´???°
    else if(x%2==0) return 0; //??¶??°????´???°??§?????????
    for(i=3;i<=rx;i+=2) //?\???°????????????????????????????????¨???????´???°??????
        if(x%i==0) return 0;
    return 1;
}

int main(void){
    int i,n,c;
    for(;;){
        scanf("%d", &n)
        if(n==0) break;
        c=0; //?????????
        for(i=n+1;i<=2*n;i++)
            if(isPrime(i)) c++;
        printf("%d\n", c);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:24: error: expected ';' before 'if'
   19 |         scanf("%d", &n)
      |                        ^
      |                        ;
   20 |         if(n==0) break;
      |         ~~
Language: C

#include <stdio.h>

int main() {
  int i, j;
  int pri[i] = {};
  int n, p;

  for(i = 2; i < 249612; i++)
    pri[i] = 1;
  for(i = 2; i * i < 249612; i++) {
    if(pri[i] == 1) {
      for(j = (i * 2); j < 249612; j+=i){
        pri[j] = 0;
      }
    }
  }

  while(1) {
    p = 0;
    scanf("%d", &n);
    if(n == 0)
      break;
    else if (n < 0 || n > 123556)
      scanf("%d", &n);
    for(i = n + 1; i <= 2n; i++) {
      if(pri[n] == 1)
        p++;
    }
    printf("%d", p);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:25: error: invalid suffix "n" on integer constant
   25 |     for(i = n + 1; i <= 2n; i++) {
      |                         ^~
Language: C

#include<cstdio>
#define N 250000

int main(void){
	int i,j;
	int num[N];
	int n,count;

	num[0]=0;
	for(i=1;i<N;i++)
		num[i]=1;
	for(i=1;i<N;i++)
		if(num[i])
			for(j=i+i+1;j<=N;j+=i+1)
				num[j]=0;

  for(;;){
    scanf("%d",&n);
    if(!n)
      break;

		count=0;
		for(i=n; i<=2*n-1; i++)
			if(num[i]) count++;
  
    printf("%d\n",count);
	}

	return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include <iostream>
using namespace std;
int main(){
	int i,j,n,p[123457*2]={0};
	char buf[120], p;
	for(i=2;i<123457;i++) if(!p[i]) for(j=i*2;j<123457*2;j+=i) p[j]=1;
	for(i=2;i<123457*2;i++) p[i]=p[i-1]+!p[i];
	while(cin>>n,n) cout << p[2*n+1] - p[n] << endl;
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
using namespace std;

int p[246913];
bool is_prime[246913];
int prime(int n){
	int sum = 0;
	for(int i=0;i<=2*n;i++){
		is_prime[i] = true;
	}
	is_prime[0] = is_prime[1] = false;
	for(int i=2;i<=2*n;i++){
		if(is_prime[i] == true){
			p[sum++] = i;
		}
		for(int j=i+i;j<=2*n;j+=i){
			is_prime[j] = false;
		}
	}
	return sum;
}

int main()
{
	int n;
	while(cin >> n){
		if(n==0)
			break;
		int ans = 0;
		int a = prime(n);
		for(int i=0;i<a;i++){
			if(p[i] > n && p[i] <= 2*n)
				ans++;
		}
		cout << ans << endl;
	}
	return 0;
}
	

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.