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

#include<iostream>
using namespace std;

int main(){
int C[3],ans,a,b;
while(cin>>c[0]>>c[1]>>c[2]){
b=c[0]+c[1];
ans=0;
for(int i=1;i<11;i++){
if(i!=c[0]&&i!=c[1]&&i!=c[2]){
c=b;
c+=i;
if(c<=20)ans++;}}
if(ans>=4)cout<<"YES"<<endl;
else cout<<"NO"<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'c' was not declared in this scope
    6 | while(cin>>c[0]>>c[1]>>c[2]){
      |            ^
Language: C++

#include <iostream>
#include <queue>

using namespace std;

int main(){

	int c[3];
	queue <int> ans;
	while(cin>>c[0]){
		if(c[0]==0){
			break;
		}
		for(int i=1;i<3;i++){
			cin>>c[i];
		}
		int data[10+1];
		int sum;
		for(int i=1;i<=10;i++){
			data[i]=1;
		}
		for(int i=0;i<3;i++){
			data[c[i]]=0;
		}
		sum=(c[0]+c[1]);

		int p=0;
		for(int i=1;i<=10;i++){
			if(c[0]!=i && c[1] != i &&c[2] != i){
				if(sum+data[i]<=20){
					p++;
				}
			}
		}
		if(p>3){
			cout<<"YES"<<endl:
		}
		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;

}
/*
Sample Input
1 2 3
5 6 9
8 9 10
Output for the Sample Input
YES
YES
NO
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:36:42: error: expected ';' before ':' token
   36 |                         cout<<"YES"<<endl:
      |                                          ^
      |                                          ;
Language: C++

int main(){
	for(int a,b,c;std::cin>>a>>b>>c;){
		int x=20-a-b,f=3;
		if(x<a)f--;
		if(x<b)f--;
		if(x<c)f--;
		std::cout<<((x-f>4)?"YES\n":"NO\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:28: error: 'cin' is not a member of 'std'
    2 |         for(int a,b,c;std::cin>>a>>b>>c;){
      |                            ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:7:22: error: 'cout' is not a member of 'std'
    7 |                 std::cout<<((x-f>4)?"YES\n":"NO\n");
      |                      ^~~~
a.cc:7:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;

class Main{

static class DataOfPCK{

int num;
int answer;

DataOfPCK(int num,int answer){
this.num=num;  this.answer=answer;
}

static final Comparator<DataOfPCK> ANSWER_ORDER=new AnswerOrderComprator();

private static class AnswerOrderComparator implements Comparator<DataOfPCK>{
public int compare(DataOfPCK d1,DataOfPCK d2){
return (d1.answer>d2.answer)?1:(d1.answer<d2.answer)?-1:0;
}
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
ArrayList<DataOfPCK> array=new ArrayList<DataOfPCK>();
HashMap<Integer,Integer> dic=new HashMap<Integer,Integer>();
DataOfPCK d;
int p,rank;

while(!(line=br.readLine()).equals("0,0")){
String[] values=line.split(",");
int num=Integer.parseInt(values[0]);
int answer=Integer.parseInt(values[1]);
array.add(new DataOfPCK(num,answer));
}

Collections.sort(array,DataOfPCK.ANSWER_ORDER);

p=-1;
rank=1;
for(int i=array.size()-1;i>=0;i--){
d=array.get(i);
if(d.answer==p){
dic.put(d.num,rank);
}
else{
dic.put(d.num,rank);
p=d.answer;
rank++;
}
}

while((line=br.readLine())!=null){
System.out.println(dic.get(Integer.parseInt(line)));
}
}

}

Compiler output:
Main.java:20: error: cannot find symbol
static final Comparator<DataOfPCK> ANSWER_ORDER=new AnswerOrderComprator();
                                                    ^
  symbol:   class AnswerOrderComprator
  location: class DataOfPCK
1 error
Language: Java

import java.util.*;
public class aoj0061 {
	static final Scanner stdin = new Scanner(System.in);
	public static void main(String[] args){
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		TreeMap<Integer, Integer>rmap = new TreeMap<Integer, Integer>(Collections.reverseOrder());
		while(true){
			String[] record = stdin.nextLine().split(",");
			if(record[0].equals("0") && record[1].equals("0")) break;
			int num = Integer.parseInt(record[1]);
			map.put(record[0], num);
			rmap.put(num, 1);
		}
		Iterator<Integer> itr = rmap.keySet().iterator();
		int rank = 1;
		while(itr.hasNext()) rmap.put(itr.next(), rank++);
		while(stdin.hasNext())
			System.out.println( rmap.get( map.get(stdin.nextLine()) ) );
	}
}

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

import java.util.*;
class main{
    public static void Main(String args[]){
        Scanner sc = new Scanner(System.in);
        ArrayList <Integer>array = new ArrayList();
        while(true){
            String input =  sc.next();
            String[] ranks =  input.split(",");
            if(ranks[0] == ranks[1] && ranks[0] == 0){
                break;
            }else{
                array.add(Integer.praseInt(ranks[1]));
            }
        }
        while(sc.hasNext()){
            int address = sc.nextInt();
            int requestedScore = array.get(address);
            int count = 0;
            for(int i = 0; i < array.size(); i++){
                if(requestedScore < array.get(i)){
                    count++;
                }
            }
            println(array.size() - count);
        }
    }
}


Compiler output:
Main.java:9: error: bad operand types for binary operator '=='
            if(ranks[0] == ranks[1] && ranks[0] == 0){
                                                ^
  first type:  String
  second type: int
Main.java:12: error: cannot find symbol
                array.add(Integer.praseInt(ranks[1]));
                                 ^
  symbol:   method praseInt(String)
  location: class Integer
Main.java:24: error: cannot find symbol
            println(array.size() - count);
            ^
  symbol:   method println(int)
  location: class main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
Language: Java

import java.util.*;
class main{
    public static void Main(String args[]){
        Scanner sc = new Scanner(System.in);
        ArrayList <Integer>array = new ArrayList();
        while(true){
            String input =  sc.next();
            String[] ranks =  input.split(",");
            if(ranks[0] == ranks[1] && ranks[0] == "0"){
                break;
            }else{
                array.add(Integer.praseInt(ranks[1]));
            }
        }
        while(sc.hasNext()){
            int address = sc.nextInt();
            int requestedScore = array.get(address);
            int count = 0;
            for(int i = 0; i < array.size(); i++){
                if(requestedScore < array.get(i)){
                    count++;
                }
            }
            println(array.size() - count);
        }
    }
}


Compiler output:
Main.java:12: error: cannot find symbol
                array.add(Integer.praseInt(ranks[1]));
                                 ^
  symbol:   method praseInt(String)
  location: class Integer
Main.java:24: error: cannot find symbol
            println(array.size() - count);
            ^
  symbol:   method println(int)
  location: class main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.*;
class main{
    public static void Main(String args[]){
        Scanner sc = new Scanner(System.in);
        ArrayList <Integer>array = new ArrayList();
        while(true){
            String input =  sc.next();
            String[] ranks =  input.split(",");
            if(ranks[0] == ranks[1] && ranks[0] == "0"){
                break;
            }else{
                array.add(Integer.parseInt(ranks[1]));
            }
        }
        while(sc.hasNext()){
            int address = sc.nextInt();
            int requestedScore = array.get(address);
            int count = 0;
            for(int i = 0; i < array.size(); i++){
                if(requestedScore < array.get(i)){
                    count++;
                }
            }
            println(array.size() - count);
        }
    }
}


Compiler output:
Main.java:24: error: cannot find symbol
            println(array.size() - count);
            ^
  symbol:   method println(int)
  location: class main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.*;
class main{
    public static void Main(String args[]){
        Scanner sc = new Scanner(System.in);
        ArrayList <Integer>array = new ArrayList();
        while(true){
            String input =  sc.next();
            String[] ranks =  input.split(",");
            if(ranks[0] == ranks[1] && ranks[0] == "0"){
                break;
            }else{
                array.add(Integer.parseInt(ranks[1]));
            }
        }
        while(sc.hasNext()){
            int address = sc.nextInt();
            int requestedScore = array.get(address);
            int count = 0;
            for(int i = 0; i < array.size(); i++){
                if(requestedScore < array.get(i)){
                    count++;
                }
            }
            System.out.println(array.size() - count);
        }
    }
}


Compiler output:
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Language: Java

import java.util.*;
class main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        ArrayList <Integer>array = new ArrayList();
        while(true){
            String input =  sc.next();
            String[] ranks =  input.split(",");
            if(ranks[0] == ranks[1] && ranks[0] == "0"){
                break;
            }else{
                array.add(Integer.parseInt(ranks[1]));
            }
        }
        while(sc.hasNext()){
            int address = sc.nextInt();
            int requestedScore = array.get(address);
            int count = 0;
            for(int i = 0; i < array.size(); i++){
                if(requestedScore < array.get(i)){
                    count++;
                }
            }
            System.out.println(array.size() - count);
        }
    }
}


Compiler output:
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Language: C

#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	int x[10000],y[10000],a,s,i=0,j,sum=0,z[10000]={};
	while(1){
		scanf("%d,%d",&s,&a);
		if(s==0) break;
		x[s-1]=a;
		y[s-1]=x[s-1];
		sum++;
	}
	sort(x,x+sum);
	int r=100;
	for(i=0;i<sum;i++){
		for(j=0;j<sum;j++){
		if(x[i]<x[j]){
			if(r!=x[j]){
			z[i]++;
			r=x[j];
		}
		}} r=100;}
int d;
				while(scanf("%d",&d)!=EOF){
					for(i=0;i<sum;i++){
						if(x[i]==y[d-1]){
					printf("%d\n",z[i]+1);
					goto yu;
						}}yu:;
				}
				return 0;
}

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

#include<iostream>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
using namespace std;

int main(){
  pair<int,int> fun[100];
  int num,acc,tel,i=0,tmp;
  int j,z;
  while(1){
    scanf("%d,%d",&num,&acc);
    if(num == 0 && acc == 0) break;
    fun[i] = make_pair(acc,num);
    i++;
  }
  sort(fun,fun+i);
  tmp = fun[i-1].first;
  j = 1;
  fun[i-1].first = j;
  for(z=i-2;z>=0;z--){
    if(tmp == fun[z].first){
      fun[z].first = j;
    }
    else{
      j++;
      tmp = fun[z].first;
      fun[z].first = j;
    }
  }
  while(cin >> tel){
    for(j=0;j<i;j++){
      if(fun[j].second == tel){
	cout << fun[j].first << endl;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   18 |   sort(fun,fun+i);
      |   ^~~~
      |   sqrt
Language: C++

#include<iostream>
#include<set>
#include<cstdio>
using namespace std;
int main() {
	int a, b;
	set<int> c;
	int d[101];
	while (scanf_s("%d,%d", &a, &b) && a != 0 && b != 0) {
		c.insert(b);
		d[a] = b;
	}
	int i = c.size();
	while (cin >> a){
		b = d[a];
		set<int>::iterator it = c.end();
		it--;
		int sum = 0;
		for (int j = 0; j < i; j++) {
			sum++;
			if ((*it) == b) {
				cout << sum << endl;
				break;
			}
			it--;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         while (scanf_s("%d,%d", &a, &b) && a != 0 && b != 0) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
using namespace std;
typedef pair<int,int> pp;

bool cmp( pp a , pp b){
	return a.second < b.second;
}

int main(){
	int a,b,n;
	vector<pp> hello;
	while(scanf("%d,%d",&a,&b) && a){
			hello.push_back(make_pair(a,b));
	}
	vector<int> rank(hello.size());
	sort(hello.begin(),hello.end(),cmp);
	int r = 1;
	int mi = 0;
	for(int i=0;i<hello.size();i++){
		if(mi < hello[i].second){
			r++;
			mi = hello[i].second;
		}
		rank[i] = r ;
			
	}
	while(cin >> n){
		cout << rank[n-1] << endl;
	}
}

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

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
typedef pair<int,int> pp;

bool cmp( pp a , pp b){
	return a.second > b.second;
}

int main(){
	int a,b,n;
	vector<pp> hello;
	while(scanf("%d,%d",&a,&b) && a){
			hello.push_back(make_pair(a,b));
	}
	vector<int> rank(hello.size());
	sort(hello.begin(),hello.end(),cmp);
	int r = 0;
	int mi = INT_MAX;
	for(int i=0;i<hello.size();i++){
		if(mi > hello[i].second){
			r++;
			mi = hello[i].second;
		}
		rank[hello[i].first-1] = r ;
				
	}
	
	while(cin >> n){
		cout << rank[n-1] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: 'INT_MAX' was not declared in this scope
   22 |         int mi = INT_MAX;
      |                  ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <algorithm>
  +++ |+#include <climits>
    6 | using namespace std;
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); }

struct J
{
    int p;
    J(int p) : p(p){}
    bool operator () (int x)
    { return p < x; }
};

int main()
{
    map<int, int> team;
    vint          points;
    
    int n, p; char k;
    while(cin >> n >> k >> p && (n || p))
    {
        points.push_back(p);
        team.insert(pair<int, int>(n, p));
    }
    
    sort(ALL(points));
    points.erase(unique(ALL(points)), points.end());
    
    while(cin >> n)
    {
        J j(team[n]);
    
        cout << count_if(ALL(points), j) + 1 << endl;
    }
}

#endif

Compiler output:
a.cc:69:2: error: #endif without #if
   69 | #endif
      |  ^~~~~
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;

int date[100000];
bool bit[31];
int did[31];

int main()
{
	memset(bit,false,sizeof(bit));
	while(true)
	{
		int a,b;
		scanf("%d,%d",&a,&b);
		if(a==0&&b==0)break;
		bit[b]=true;
		date[a]=b;
	}
	int k=1;
	for(int i=30;i>-1;i--)
	{
		if(bit[i]==true)
		{
			did[i]=k;
			k++;
		}
	}
	int j;
	while(scanf("%d",&j)!=EOF)
	{
		printf("%d",did[date[j]]);
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(bit,false,sizeof(bit));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

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

vector<int> da[31];
int main() {
	int id,sc,n,i,j;
	while (scanf("%d,%d",&id,&sc)) {
		if (id==0 && sc==0) break;
		da[sc].push_back(id);
	}
	while (cin >> id) {
		n=0;  
		for (i=30;i>=0;i--) {
			if (da[i].size()>0) {
				n++;
				for (j=0; j<da[i].size(); j++) if (da[i][j]==id) cout << n << endl;
			}
		}
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected '}' at end of input
   22 |         return 0;
      |                  ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

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

struct P{
    int num;
    int point;
    int rank;
    static bool more (const P& left,const P& right){
        return left.point > right.point;
    }
};

int main(){
    int n,cnt=0;
    vector <P> data;
    P tmp;
    while(1){
        scanf("%d,%d",&tmp.num,&tmp.point);
        if(tmp.num == 0 && tmp.point == 0) break;
        data.push_back(tmp);
        cnt++;
    }
    sort(data.begin(),data.end(),P::more);
    for(int i=0,rank=1;i<cnt;i++){
        if(i == 0) data[i].rank = rank;
        else if(data[i].point == data[i-1].point) data[i].rank = rank;
        else if(data[i].point < data[i-1].point){
            rank++;
            data[i].rank= rank;
        }
    }
    
    while(scanf("%d",&n) != EOF){
        for(int i=0;i<cnt;i++){
            if(data[i].num == n){
                cout << data[i].rank << endl;
                break;
            }
        }
    }
}

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

team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    try:
        n = input()
        print point[team[n]][0]
    except EOFerror:
	break

Compiler output:
a.cc:1:1: error: 'team' does not name a type
    1 | team = [0 for i in range(101)]
      | ^~~~
Language: C++

#include <algorithm>
#include <cstdio>
using namespace std;

int main(void){
  pair<int,int> p[100];
  int num,point,i = 0;

  while(1){
    scanf("%d,%d" ,&num ,&point);
    if(num == 0 && point == 0) break;
    
    p[i] = make_pair(-point,num);
    i++;
  }

  sort(p,p+i);
  
  int key;
  while(cin >> key){
    int cnt = 1;
    for(int j = 1 ; p[j].second!=key ; j++){
      if((-1)*p[j].first != (-1)*p[j-1].first) cnt++;
    }
    cout << cnt << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'cin' was not declared in this scope
   20 |   while(cin >> key){
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cstdio>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << cnt << endl;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << cnt << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <cstdio>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <algorithm>
using namespace std;

int main(void){
  pair<int,int> p[101];
  int num,point,i = 0;
  char cm; 
 
  while(1){
    cin >> num >> cm >> point;
    if(num == 0 && point == 0) break;
    
    p[i] = make_pair(-point,num);
    i++;
  }

  sort(p,p+i);
  
  int key;
  while(cin >> key){
    int cnt = 1;
    for(int j = 1 ; p[j].second!=key ; j++){
      if((-1)*p[j].first != (-1)*p[j-1].first) cnt++;
    }
    cout << cnt << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> num >> cm >> point;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:20:9: error: 'cin' was not declared in this scope
   20 |   while(cin >> key){
      |         ^~~
a.cc:20:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << cnt << endl;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << cnt << endl;
      |                    ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstdio>

using namespace std;

typedef pair<int,int>pii;

int main(void){

	map<int,int>mp;
	vector<pii>v;
	while(true){
		int a,b;
		scanf("%d,%d",&a,&b);
		if(a==0 && b==0)break;
		v.push_back(pii(b,a));
	}
	sort(v.begin(),v.end());
	reverse(v.begin(),v.end());

	int k=1;
	for(int i=0;i<v.size();i++){
		mp[v[i].second]=k;
		if(v[i].first!=v[i+1].first)k++;
	}

	int n;
	while(cin >> n){
		cout << mp[n] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |         sort(v.begin(),v.end());
      |         ^~~~
      |         short
a.cc:22:9: error: 'reverse' was not declared in this scope
   22 |         reverse(v.begin(),v.end());
      |         ^~~~~~~
Language: Java

import java.util.Scanner;

public class J0062{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[] nums = new int[10];
		
		while(sc.hasNext()){
			String s = sc.next();
		
			for(int i=0; i<10; i++)
				nums[i] = Integer.parseInt("" + s.charAt(i));
			
			for(int i=0; i<9; i++){
				for(int j=0; j<9-i;	j++){
					nums[j] = (nums[j] + nums[j+1])%10;	
				}
			}
		
			System.out.println(nums[0]);
		}
	
	}
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int[] a = new int[10];
			char[] s = sc.next().toCharArray();
			for(int i=0;i<10;i++)a[i]=s[i]-'0';
			for(int j=9;j>0;j--){
				int[] b = new int[j];
				for(int i=0;i<j;i++){
					b[i]=(a[i]+a[i+1])%10;
				}
				a = b;
			}
			System.out.println(a[0]);
		}

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

package main;

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

public class WhatIsBottommost {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			String line = sc.nextLine();
			int[] carray = new int[line.length()];
			for(int i = 0 ;i<line.length();i++){
				carray[i] = Character.getNumericValue(line.charAt(i));
			}
			for(int i=line.length();i>0;i--){
				int array[] = new int[i-1];
				for(int j = 0 ; j < i-1;j++){
					array[j] = (carray[j] + carray[j+1])%10;
				}
				if(i ==2){
					System.out.println(array[0]);
					break;
				}
				carray = array;
			}
					
		}
	}

}

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

import java.util.Scanner;

public class aoj0062 {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int[] a = new int[10];
		String str;;
		
		while(scan.hasNext()){
			str = scan.next();
			char[] ch = str.toCharArray();

			for(int i = 0; i < 10; i++){
				a[i] = Integer.parseInt("" + ch[i]);

			}
			
			for(int i = 0; i < 9; i++){
				for(int j = 0; j < 9 - i; j++){
					a[j] = a[j] + a[j + 1];
					if(a[j] >= 10)a[j] -= 10;
				}
			}
			System.out.println(a[0]);
		}
	}
}

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

#include <bits/stdc++.h>

using namespace std;

int main() {

    char num[10][10];

    while(1) {

        for(int i = 0; i < 10; ++i) {
            if(!(cin >> num[0][i])) {
                return 0;
            }
            num[0][i] -= '0';
        }

        for(int i = 1; i < 10; ++i) {
            for(int j = 0; j < 10 - i; ++j) {
                num[i][j] = (num[i - 1][j] + num[i - 1][j + 1]) % 10;
            }
        }

        cout << (int)num[9][0] << endl;

    }

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

#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 30
int main(void)
{
	char num[11],a;
	int n[10];
	while (gets_s(num, 11) != NULL) {
		for (int i = 0; num[i] != '\0'; ++i) {
			a = num[i];
			sscanf_s(&a, "%d", &n[i]);
		}
		for (int i = 10; i >= 1; --i) {
			for (int j = 0; j < i - 1; ++j) {
				n[j] = (n[j] + n[j + 1]) % 10;
			}
		}
		printf("%d\n", n[0]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'gets_s' was not declared in this scope
   13 |         while (gets_s(num, 11) != NULL) {
      |                ^~~~~~
a.cc:16:25: error: 'sscanf_s' was not declared in this scope; did you mean 'scanf_s'?
   16 |                         sscanf_s(&a, "%d", &n[i]);
      |                         ^~~~~~~~
      |                         scanf_s
Language: C++

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

int main() {
	char ss[10];
	int a[10];
	while (cin >> ss) {
		for (int i = 0; i < 10; i++) {
			a[i] = ss[i] - '0';
		}
		int x = a[0] + a[9] + (a[1] + a[8]) * 9 + (a[2] + a[4] + a[5] + a[7]
			) * 6 + (a[3] + a[6]) * 4;
		string sa=to_string(x);
		reverse(sa.begin(), sa.end());
		cout << sa[0] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'reverse' was not declared in this scope
   15 |                 reverse(sa.begin(), sa.end());
      |                 ^~~~~~~
Language: C++

#include<cstdio>
int main(){char s[11],a,i;while(gets(s)){for(a=9;a>=0;a--)for(i=0;i<a;s[i]=(s[i]+s[i+1]-6)%10+48,i++);printf("%c\n",*s);}}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:33: error: 'gets' was not declared in this scope; did you mean 'getw'?
    2 | int main(){char s[11],a,i;while(gets(s)){for(a=9;a>=0;a--)for(i=0;i<a;s[i]=(s[i]+s[i+1]-6)%10+48,i++);printf("%c\n",*s);}}
      |                                 ^~~~
      |                                 getw
Language: C++

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

using namespace std;

int main()
{
  vector<int> a(10);
  while (scanf("%d ", a) == 1) {
    for (int i = 1; i < 10; i++) {
      scanf("%d ", &a[i]);
    }
    for (int i = 9; i >= 1; i--) {
      vector<int> b(i);
      for (int j = 0; j < i; j++) {
	b[j] = (a[j] + a[j + 1]) % 10;
      }
      a = b;
    }
    printf("%d\n", a[0]);
  }
  return 0; 

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: expected '}' at end of input
   23 |   return 0;
      |            ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

Int abs(Int n){
	return (n>=0)?n:-n;
}

int main() {
	Int n;
	for(;cin>>n;){
		Int m,pow;
		int i,j;
		for(i=10;i>1;i--){
			pow=1;
			m=0;
			for(j=0;j<i-1;j++){
				m+=abs(n/pow%10+n/pow/10%10)%10*pow;
				pow*=10;
			}
			n=m;
		}
		cout<<n<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:39: error: call of overloaded 'abs(Int)' is ambiguous
   44 |                                 m+=abs(n/pow%10+n/pow/10%10)%10*pow;
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from a.cc:2:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:31:5: note: candidate: 'Int abs(Int)'
   31 | Int abs(Int n){
      |     ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

top[11];
    for(int i = 0; i <10; i++)
    {
	cin >> top[i];
	tri[0][i] = top[i] - '0';
	//printf("%d ",tri[0][i]);
    }
    int cont = 1;
    for(int i = 9; i > 0; i--){
	for(int j = 0; j < i; j++){
	    if(tri[cont-1][j] + tri[cont-1][j+1] > 9)
		    tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1] -10 ;
		else tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1];
	    //printf("%d ",tri[cont][j]);
	}
	cont++;
	//puts("");
    }
    cout << tri[9][0] << endl;
}

Compiler output:
a.cc:1:1: error: 'top' does not name a type
    1 | top[11];
      | ^~~
a.cc:2:5: error: expected unqualified-id before 'for'
    2 |     for(int i = 0; i <10; i++)
      |     ^~~
a.cc:2:20: error: 'i' does not name a type
    2 |     for(int i = 0; i <10; i++)
      |                    ^
a.cc:2:27: error: 'i' does not name a type
    2 |     for(int i = 0; i <10; i++)
      |                           ^
a.cc:9:5: error: expected unqualified-id before 'for'
    9 |     for(int i = 9; i > 0; i--){
      |     ^~~
a.cc:9:20: error: 'i' does not name a type
    9 |     for(int i = 9; i > 0; i--){
      |                    ^
a.cc:9:27: error: 'i' does not name a type
    9 |     for(int i = 9; i > 0; i--){
      |                           ^
a.cc:19:5: error: 'cout' does not name a type
   19 |     cout << tri[9][0] << endl;
      |     ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

= 0; i <10; i++)
    {
	cin >> top[i];
	tri[0][i] = top[i] - '0';
	//printf("%d ",tri[0][i]);
    }
    int cont = 1;
    for(int i = 9; i > 0; i--){
	for(int j = 0; j < i; j++){
	    if(tri[cont-1][j] + tri[cont-1][j+1] > 9)
		    tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1] -10 ;
		else tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1];
	    //printf("%d ",tri[cont][j]);
	}
	cont++;
	//puts("");
    }
    cout << tri[9][0] << endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '=' token
    1 | = 0; i <10; i++)
      | ^
a.cc:1:6: error: 'i' does not name a type
    1 | = 0; i <10; i++)
      |      ^
a.cc:1:13: error: 'i' does not name a type
    1 | = 0; i <10; i++)
      |             ^
a.cc:8:5: error: expected unqualified-id before 'for'
    8 |     for(int i = 9; i > 0; i--){
      |     ^~~
a.cc:8:20: error: 'i' does not name a type
    8 |     for(int i = 9; i > 0; i--){
      |                    ^
a.cc:8:27: error: 'i' does not name a type
    8 |     for(int i = 9; i > 0; i--){
      |                           ^
a.cc:18:5: error: 'cout' does not name a type
   18 |     cout << tri[9][0] << endl;
      |     ^~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

int main(){
	string s;
	int num[10];

	int k[10][12] = {0};

	k[0][1] = 1;

	for(int i = 1; i < 10; i++){
		for(int j = 1; j < 12; j++){
			k[i][j] = k[i-1][j-1]+k[i-1][j];
		}
	}

	while(cin >> s){
		if(s == "0")break;
		int sum = 0;
		for(int i = 0; i < s.size(); i++){
			sum += (s[i]-'0')*k[9][i+1];
		}
		
		cout << sum%10 << endl;
	}
	
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'string' was not declared in this scope
    2 |         string s;
      |         ^~~~~~
a.cc:15:15: error: 'cin' was not declared in this scope
   15 |         while(cin >> s){
      |               ^~~
a.cc:15:22: error: 's' was not declared in this scope
   15 |         while(cin >> s){
      |                      ^
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout << sum%10 << endl;
      |                 ^~~~
a.cc:22:35: error: 'endl' was not declared in this scope
   22 |                 cout << sum%10 << endl;
      |                                   ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	string str;
	while(cin>>str){
		int num[10];
		for(int i=0;i<10;i++){
			num[i]=str[i]-48;
		}
		for(int j=9;j>=0;j--){
			for(int k=0;k<j;k++){
				num[k] += num[k+1];
			}
		}
		cout<<num[k]%10<<endl;	
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: 'k' was not declared in this scope
   16 |                 cout<<num[k]%10<<endl;
      |                           ^
Language: Java

import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.NoSuchElementException;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int count = 0;
		while(sc.hasNext()) {
			String a = sc.next();
			String b = new StringBuffer(a).reverse().toString();
			if(a.equals(b)) {
				count++;
			}
			
			
		}
		out.println(count);
		out.flush();
	}


//------------------------------//
//-----------//
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}

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

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

public class Main {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		int cnt = 0;
		int dataset = 50;
		String[] str = new String[dataset];


		for(int i = 0; i < dataset; i++){

			try {
				str[i] = input.readLine();

			} catch (IOException e) {
				// TODO ????????????????????? catch ????????????
				e.printStackTrace();
			}
		}


		for(int j = 0; j < dataset; j++) {
			StringBuffer sb = new StringBuffer(str[j]);
			if(str[j].equals(sb.reverse().toString())) {
				cnt++;
			}

		}
		System.out.println(cnt);
	}

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
port java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.Scanner;
^
4 errors
Language: Java

#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;
 
int main()
{
    string s;
    int n, i;
    n = 0;
    while (cin>>s) {
        n++;
        for (i = 0; i < s.size()/2; i++) {
            if (s[i] != s[s.size()-i-1]) {
                n--;
                break;
            }
        }
    }
    cout<<n<<endl;
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<math.h>
^
Main.java:3: error: illegal character: '#'
#include<vector>
^
Main.java:4: error: illegal character: '#'
#include<algorithm>
^
Main.java:5: error: illegal character: '#'
#include<cstdio>
^
Main.java:6: error: illegal character: '#'
#include<string>
^
Main.java:23: error: not a statement
    cout<<n<<endl;
           ^
Main.java:9: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
  (use --enable-preview to enable unnamed classes)
8 errors
Language: Java

ipmport  java.util.Scanner;

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

		while(sc.hasNext())
		{
			String str = sc.next();

			for(int i=0; i<str.length(); i++)
			{
				if(str.charAt(i)==str.charAt(str.length()-1-i))
				{
					if(str.length()-1-i<= i)
					{
						count++;
						break;
					}
					continue;
				}
				else
					break;
			}
		}
		System.out.println(count);

	}

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
ipmport  java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 0;
		while(sc.hasNext()){
			String s = sc.next();
			if(s.equals((new StringBuffer(s)).reverse().toString()))n++;
		}
		System.out.println(c);
	}
}

Compiler output:
Main.java:12: error: cannot find symbol
		System.out.println(c);
		                   ^
  symbol:   variable c
  location: class Main
1 error
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int l,c=0;
  char s[102]={0};
  while(~scanf("%s",s)){
    for(i=1;s[i];i++);
    for(j=0;j>=i;j++){
      if(s[i]-s[j])break;
      i--;
    }
    if(j<i)c++;
  }
  printf("%d",c);
  return 0;
}
	     
    

Compiler output:
main.c: In function 'main':
main.c:7:9: error: 'i' undeclared (first use in this function)
    7 |     for(i=1;s[i];i++);
      |         ^
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:9: error: 'j' undeclared (first use in this function)
    8 |     for(j=0;j>=i;j++){
      |         ^
Language: C

#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main(void)
{
	int c, n = 0;
	char s1[100], s2[100];
	
	while (scanf("%s", s1) != EOF){
		c = 0;
		for (int i = 0; i <= strlen(s1); i++){
			s2[i] = s1[i];
		}
		
		reverse(s2, s2 + strlen(s1));
		for (int i = 0; i <= strlen(s1); i++){
			if (s1[i] == s2[i]){
				c++;
				if (c == strlen(s1)){
					n++;
				}
			}
		}
	}
	
	printf("%d\n", n);
	
	return (0);
}

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

#include <stdio.h>
#include <string.h>
int main(void)
{
  char a[101];
  int c=0,l;
  while(scanf("%s",a)!=EOF){
    l=strlen(a);
    int i,f=1;
    for(i=0;i<l/2;i++){
      if(a[i]!=a[l-1-i]))
	f=0;
      break;
    }
    if(f)
      c++;
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:25: error: expected statement before ')' token
   11 |       if(a[i]!=a[l-1-i]))
      |                         ^
Language: C

#include <stdio.h>
#include <string.h>
int main(){
char x[105];
int i,j,num,sum;
while(scanf("%s",x)!=EOF){
int c=strlen(x);
for(i=0;i<c/2;i++){
if(x[i]!=x[c-1-i]){
num=1;
}}}
if(num==0) sum++;
num=0;
printf("%d\n",sum);
sum=0;
}
return 0;
}

Compiler output:
main.c:17:1: error: expected identifier or '(' before 'return'
   17 | return 0;
      | ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C++

#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

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

int main(){
	
	string s;
	int cnt=0;
	while(cin>>s){
		int a = 0;
		
		bool ok = true;
		rep(i,s.size())if(s[i]!=s[s.size()-i-1])ok=false;
		
		if(ok)cnt++;
	}
	printf("%d\n",cnt):
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: expected ';' before ':' token
   30 |         printf("%d\n",cnt):
      |                           ^
      |                           ;
Language: C++

#include <stdio.h>

int main(void)
{
	char c[200];
	int ans = 0;
	int len;
	while(scanf("%s", c) != EOF){
		len = strlen(c);
		ans++;
		for(int i = 0; i < len / 2; i++){
			if(c[i] != c[len - i - 1]){
				ans--;
				break;
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'strlen' was not declared in this scope
    9 |                 len = strlen(c);
      |                       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	string s;
	int out=0;
	while(cin>>s){
		tmp=s;
		reverse(all(tmp));
		if(s==tmp)out++;
	}
	cout<<out<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   27 |                 tmp=s;
      |                 ^~~
      |                 tm
Language: C++

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

int main(){
	
	string a;
	//int n;
	int k=0;
	//cin>>n;
	while(cin>>a){
		//cin>>a;
		int f=0;
		//cout<<a.size()/2<<endl;
		for(int i=0;i<a.size()/2;i++){
			//cout<<a[i]<<a[a.size()-1-i]<<endl;
		if(a[i]!=a[a.size()-1-i])
			f=1;
		}
		if(f==0)
			k++;
		n--;
	}
	cout<<k<<endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'n' was not declared in this scope
   24 |                 n--;
      |                 ^
Language: C++

s = 0
while a = gets
	a.chop!
	f = 1
	a.size.times{|i|
		f = 0 if a[i] != a[~i]
	}
	s += f
end
p s

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = 0
      | ^
a.cc:8:9: error: 's' does not name a type
    8 |         s += f
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define sz(obj) ((int)(obj).size())

int main()
{
  string str;
  int cnt = 0;
  while (cin >> str){
    REP(i, sz(str) / 2) if (str[i] == str[sz(str) - (i + 1)]) ccnt++;
    if (ccnt == sz(str) / 2) cnt++;
    cout << cnt << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:63: error: 'ccnt' was not declared in this scope; did you mean 'cnt'?
   13 |     REP(i, sz(str) / 2) if (str[i] == str[sz(str) - (i + 1)]) ccnt++;
      |                                                               ^~~~
      |                                                               cnt
a.cc:14:9: error: 'ccnt' was not declared in this scope; did you mean 'cnt'?
   14 |     if (ccnt == sz(str) / 2) cnt++;
      |         ^~~~
      |         cnt