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

#include <bits/stdc++.h>
using namespace std;
??
#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)
??
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
??
const int INF = 1001001001;
??
int dist(pii a, pii b)
{
????????int dy = a.first - b.first;
????????int dx = a.second - b.second;
????????if(0 <= dy*dx){
????????????????dy = abs(dy);
????????????????dx = abs(dx);
????????????????return dy + max(0, dx - (dy+1-min(a.first,b.first)%2)/2);
????????}
????????else{
????????????????dy = abs(dy);
????????????????dx = abs(dx);
????????????????return dy + max(0, dx - (dy + min(a.first, b.first)%2)/2);
????????}
}
??
int main()
{
????????int m, n;
????????while(scanf("%d%d", &m, &n), m){
????????????????int s;
????????????????scanf("%d", &s);
????????????????pii conv[10];
????????????????rep(i, s)
????????????????????????scanf("%d%d", &conv[i].second, &conv[i].first);
??????????????????
????????????????int d[101][101];
????????????????rep(i, n) rep(j, m){
????????????????????????d[i+1][j+1] = INF;
????????????????????????rep(k, s)
????????????????????????????????d[i+1][j+1] = min(d[i+1][j+1], dist(pii(i+1, j+1), conv[k]));
????????????????}
??????????????????
????????????????int t, ans = 0;
????????????????scanf("%d", &t);
????????????????rep(i, t){
????????????????????????int x, y;
????????????????????????scanf("%d%d", &x, &y);
??????????????????????????
????????????????????????int cnt = 0;
????????????????????????rep(j, n) rep(k, m)
????????????????????????????????cnt += dist(pii(j+1, k+1), pii(y, x)) < d[j+1][k+1];
????????????????????????ans = max(ans, cnt);
????????????????}
????????????????printf("%d\n", ans);
????????}
????????return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ??
      | ^
a.cc:11:1: error: expected unqualified-id before '?' token
   11 | ??
      | ^
a.cc:13:1: error: expected unqualified-id before '?' token
   13 | ??
      | ^
a.cc:29:1: error: expected unqualified-id before '?' token
   29 | ??
      | ^
Language: C++

#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
using namespace std;

typedef pair <int, int> PII;
typedef PII Node;
typedef queue <Node> Queue;

typedef vector <int> VI;
typedef vector <VI> VVI;
typedef set<PII> SPII;

int w, h;
const int inf = 1<<24;
const int odx[6] = { 0, 1, 1, 1, 0, -1 };
const int ody[6] = { -1, -1, 0, 1, 1, 0 };
const int edx[6] = { -1, 0, 1, 0, -1, -1 };
const int edy[6] = { -1, -1, 0, 1, 1, 0 };

int bfs( VVI& M, int X, int Y ) {
    SPII V;
    V.clear();
    Queue Q;
    Node start( X, Y );
    Q.push( start );
    M[Y][X] = 0;
    while ( !Q.empty() ) {
        Node node = Q.front();
        Q.pop();

        int x = node.first;
        int y = node.second;
        if ( V.find( PII( x, y ) ) == V.end() ) {
            V.insert( PII( x, y ) );
            answer++;
        }

        for ( int i = 0; i < 6; i++ ) {
            int nx = x + ( y%2==0 ? edx[i] : odx[i] );
            int ny = y + ( y%2==0 ? edy[i] : ody[i] );
            if ( nx < 0 || nx >= w || ny < 0 || ny >= h ) continue;
            if ( M[y][x] + 1 >= M[ny][nx] ) continue;
            M[ny][nx] = M[y][x] + 1;
            Node nnode( nx, ny );
            Q.push( nnode );
        }
    }
    return V.size();
}

int main() {
    while ( cin >> w >> h ) {
        VVI M( h+1, VI( w+1, inf ) );

        int s;
        cin >> s;
        for ( int i = 0; i < s; i++ ) {
            int x, y;
            cin >> x >> y;
            x--;
            y--;
            bfs( M, x, y );
        }

        int answer = 0;
        VVI backup = M;
        int t;
        cin >> t;
        for ( int i = 0; i < t; i++ ) {
            M = backup;
            int x, y;
            cin >> x >> y;
            x--;
            y--;
            answer = max( answer, bfs( M, x, y ) );
        }

        cout << answer << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int bfs(VVI&, int, int)':
a.cc:49:13: error: 'answer' was not declared in this scope
   49 |             answer++;
      |             ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>

using namespace std;

typedef pair<int,int> pii;
int n,m;
int s,t;
pii ps[101];
// »ê¼êÌÀW©çêÔß¢RrjÖÌ£
int dists[101][101];
const int INF=1000000000;
pii cand[101];
bool used[101][101];
bool noSet[101][101];

const int dy[2][6]={{-1,-1,0,1,1,0},{-1,-1,0,1,1,0}};
const int dx[2][6]={{-1,0,1,0,-1,-1},{0,1,1,1,0,-1}};

int calcDist(pii &p1,pii &p2){

    return 0;
}

int updateMinDist(int sx,int sy,bool isSearch=true){
    memset(used,0,sizeof(used));
    queue<pii> q[2];
    int cur=0;
    int nxt=1;
    int cnt=0;
    pii sp=pii(sy,sx);
    used[sy][sx]=true;
    dists[sy][sx]=0;
    int res=1;
    q[cur].push(sp);
    while(q[cur].size()){
        while(q[cur].size()){
            pii p=q[cur].front();q[cur].pop();
            for(int i=0;i<6;i++){
                int ny=dy[p.first%2][i]+p.first;
                int nx=dx[p.first%2][i]+p.second;
                if(ny>=0&&nx>=0&&ny<n&&nx<m&&!used[ny][nx]){
                    used[ny][nx]=true;
                    q[nxt].push(pii(ny,nx));
                    if(isSearch)
                        dists[ny][nx]=min(dists[ny][nx],cnt+1);
                    else{
                        if(dists[ny][nx]>cnt+1){
                            res++;
                        }
                    }
                }
            }
        }
        cnt++;
        swap(cur,nxt);
    }
    return res;
}

int main(){
    while(cin>>m>>n&&(m|n)){
        memset(noSet,0,sizeof(noSet));
        cin>>s;
        for(int i=0;i<101;i++)for(int j=0;j<101;j++)dists[i][j]=INF;
        for(int i=0;i<s;i++){
            cin>>ps[i].second>>ps[i].first;
            ps[i].second--;
            ps[i].first--;
            noSet[ps[i].first][ps[i].second]=true;
        }
        for(int k=0;k<s;k++)updateMinDist(ps[k].second,ps[k].first);
        cin>>t;
        for(int i=0;i<t;i++){
            cin>>cand[i].second>>cand[i].first;
            cand[i].second--;
            cand[i].first--;
        }
        int res=0;
        for(int i=0;i<t;i++){
            int cnt=0;
            //if(used[cand[i].first][cand[i].second])continue;
            // ¡Ìê©çe_ÜÅÌ£ðvZµAß¢àÌÌÝÌp
            cnt=updateMinDist(cand[i].second,cand[i].first,false);
            res=max(res,cnt);
        }
        cout<<res<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int updateMinDist(int, int, bool)':
a.cc:28:5: error: 'memset' was not declared in this scope
   28 |     memset(used,0,sizeof(used));
      |     ^~~~~~
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 | 
a.cc: In function 'int main()':
a.cc:65:9: error: 'memset' was not declared in this scope
   65 |         memset(noSet,0,sizeof(noSet));
      |         ^~~~~~
a.cc:65:9: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <queue>
#include <utility>
#include <algorithm>

using namespace std;

#define INF (1<<30)

typedef pair<int,int> _P;
typedef pair<_P,int> P;

int map[100][100];
bool vst[100][100];
int dx1[6]={-1,0,1,0,-1,-1},dy1[6]={-1,-1,0,1,1,0};
int dx2[6]={0,1,1,1,0,-1},dy2[6]={-1,-1,0,1,1,0};

int main() {
	int m,n,s,t;
	while(scanf("%d",&m),m) {
		scanf("%d",&n);
		scanf("%d",&s);
		for(int j=0;j<n;j++) {
			for(int i=0;i<m;i++) {
				map[i][j]=INF;
			}
		}
		for(int i=0;i<s;i++) {
			int x,y;
			scanf("%d %d",&x,&y);x--;y--;
			memset(vst,false,sizeof(vst));
			map[x][y]=0;
			vst[x][y]=true;
			queue<P> que;
			que.push(P(_P(x,y),0));
			while(!que.empty()) {
				P p=que.front();que.pop();
				int *dx,*dy;
				if((p.first.second+1)%2) dx=dx1,dy=dy1;
				else dx=dx2,dy=dy2;
				for(int i=0;i<6;i++) {
					int nx=p.first.first+dx[i],ny=p.first.second+dy[i];
					if(0<=nx&&nx<m&&0<=ny&&ny<n&&!vst[nx][ny]) {
						vst[nx][ny]=true;
						map[nx][ny]=min(p.second+1,map[nx][ny]);
						que.push(P(_P(nx,ny),p.second+1));
					}
				}
			}
		}
		scanf("%d",&t);
		int ans=0;
		for(int i=0;i<t;i++) {
			int x,y;
			scanf("%d %d",&x,&y);x--;y--;
			memset(vst,false,sizeof(vst));
			vst[x][y]=true;
			queue<P> que;
			que.push(P(_P(x,y),0));
			int count=0;
			while(!que.empty()) {
				P p=que.front();que.pop();
				int *dx,*dy;
				if(p.second<map[p.first.first][p.first.second]) count++;
				if((p.first.second+1)%2) dx=dx1,dy=dy1;
				else dx=dx2,dy=dy2;
				for(int i=0;i<6;i++) {
					int nx=p.first.first+dx[i],ny=p.first.second+dy[i];
					if(0<=nx&&nx<m&&0<=ny&&ny<n&&!vst[nx][ny]) {
						vst[nx][ny]=true;
						que.push(P(_P(nx,ny),p.second+1));
					}
				}
			}
			if(ans<count) ans=count;
		}
		printf("%d\n",ans);
	}
}

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

#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
#define ck(a,b) (0<=a&&a<b)
#define Y1 b1[0]-'a'
#define X1 b1[2]-'1'
#define Y2 b2[0]-'a'
#define X2 b2[2]-'1'
using namespace std;
int dy[]={-1,0,1,0},dx[]={0,1,0,-1};
int m,n,ds,ns,nc,nj,sy,sx,gy,gx,t,
S[25][25],D[25][25][25][25]; bool V[25][25][110][4]; char b1[99],b2[99];
void dfs(int y,int x,int t,int d){
	V[y][x][t][d]=1;
	int ny,nx,c,nt,nd;
	rep(i,4){
		nd=d+i&3,ny=y+dy[nd],nx=x+dx[nd];
		if(!ck(ny,m)||!ck(nx,n)continue;
		c=D[y][x][ny][nx],nt=t+c;
		if((!S[ny][nx]||nd%2==nt/S[ny][nx]%2)&&i!=2
			&&nt<101&&c&&!V[ny][nx][nt][nd])dfs(ny,nx,nt,nd);
	}
}
int main(){
	while(cin>>m>>n,m){
		cin>>ds; rep(i,m)rep(j,n){
			S[i][j]=0; rep(k,m)rep(l,n)D[i][j][k][l]=ds;
			rep(t,110)rep(d,4)V[i][j][t][d]=0;
		}
		cin>>ns; rep(i,ns)cin>>b1>>t,S[Y1][X1]=t;
		cin>>nc; rep(i,nc)cin>>b1>>b2,D[Y1][X1][Y2][X2]=D[Y2][X2][Y1][X1]=0;
		cin>>nj; rep(i,nj)cin>>b1>>b2>>t,D[Y1][X1][Y2][X2]+=t,D[Y2][X2][Y1][X1]+=t;
		cin>>b1>>b2,sy=Y1,sx=X1,gy=Y2,gx=X2;
		rep(d,4)dfs(sy,sx,0,d);
		rep(t,101)rep(d,4)if(V[gy][gx][t][d]){
			cout<<t<<endl; goto END;
		}
		END:;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int, int)':
a.cc:17:40: error: expected ';' before 'continue'
   17 |                 if(!ck(ny,m)||!ck(nx,n)continue;
      |                                        ^~~~~~~~
a.cc:18:41: error: expected ')' before ';' token
   18 |                 c=D[y][x][ny][nx],nt=t+c;
      |                                         ^
      |                                         )
a.cc:17:19: note: to match this '('
   17 |                 if(!ck(ny,m)||!ck(nx,n)continue;
      |                   ^
Language: C++


		priority_queue<NODE> Q;
		Q.push(NODE(start,P(start.x-1,start.y),0));
		while(Q.size()){
			NODE q = Q.top(); Q.pop();
			//usleep(30000);
			if(memo[q.cost][q.cur.y][q.cur.x])continue;
			else memo[q.cost][q.cur.y][q.cur.x] = true;
			
			if(q.cur.x == goal.x && q.cur.y == goal.y){
				cout << q.cost << endl;
				break;
			}
			rep(i,4){
				int dir = i/2;
				P nextP = P(q.cur.x+dx[i],q.cur.y+dy[i]);
				int nextCost = q.cost + add[q.cur.y][q.cur.x][nextP.y][nextP.x] + d;
				if(
					nextCost > 100 || 
					!correct(nextP.x,nextP.y) || 
					binary_search(stop.begin(),stop.end(),make_pair(q.cur,nextP)) || 
					(nextP.x == q.prev.x && nextP.y == q.prev.y) || 
					(data[nextCost][nextP.y][nextP.x] != -1 && data[nextCost][nextP.y][nextP.x] == dir)
				){
					continue;
				}
				Q.push( NODE(nextP,q.cur,nextCost) );
			}
		}
	}
}

Compiler output:
a.cc:2:17: error: 'priority_queue' does not name a type
    2 |                 priority_queue<NODE> Q;
      |                 ^~~~~~~~~~~~~~
a.cc:3:17: error: 'Q' does not name a type
    3 |                 Q.push(NODE(start,P(start.x-1,start.y),0));
      |                 ^
a.cc:4:17: error: expected unqualified-id before 'while'
    4 |                 while(Q.size()){
      |                 ^~~~~
a.cc:30:9: error: expected declaration before '}' token
   30 |         }
      |         ^
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
    int x, a, b, c, d ;
    while (1) {
        scanf("%d%d", & a, & b) ;
        if (a == 0 && b == 0 || c = a + b) {
            break ;
        }
        d = 0 ;
        for (x = 1 ; x < 5 ; x ++) {
            scanf("%d%d", & a, & b) ;
            if (a + b > c) {
                c = a + b;
                d = x ;
            }
        }
        printf("%c %d\n", 'A' + d, c) ;
    }
    return 0 ;
}



Compiler output:
main.c: In function 'main':
main.c:8:35: error: lvalue required as left operand of assignment
    8 |         if (a == 0 && b == 0 || c = a + b) {
      |                                   ^
Language: C

#include<stdio.h>

char returnsname(int);

int main(void){
	
	int i,sum,a,b,c;
	int top,topn;
	
	i = 0;
	top = 0;
	
	while(1){
		
		scanf(" %d %d",&a,&b);
		
		if(a == 0 && b == 0){
			break;
		}
		
		c = a + b;
		
		if(top < c){
			top = c;
			topn = i + 1;
		}
		
		i++;
		
		if(i==5){
			switch(topn){
		case 1:
			return('A');
			break;
		case 2:
			return('B');
			break;
		case 3:
			return('C');
			break;
		case 4:
			return('D');
			break;
		case 5:
			return('E');
			break;
	}
			printf("%c %d\n",returnsname(topn),top);
			i = 1;
			top = 0;
		}
	}
	
	return(0);
	
}

Compiler output:
/usr/bin/ld: /tmp/cc6rbhsH.o: in function `main':
main.c:(.text+0xc5): undefined reference to `returnsname'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

int main(void){
	
	int i,sum,a,b,c;
	int top,topn;
	
	i = 0;
	top = 0;
	
	while(1){
		
		scanf(" %d %d",&a,&b);
		
		if(a == 0 && b == 0){
			break;
		}
		
		c = a + b;
		
		if(top < c){
			top = c;
			topn = i + 1;
		}
		
		i++;
		
		if(i==5){
			switch(topn){
		case 1:
			return('A');
			break;
		case 2:
			return('B');
			break;
		case 3:
			return('C');
			break;
		case 4:
			return('D');
			break;
		case 5:
			return('E');
			break;
	}
			printf("%c %d\n",returnsname(topn),top);
			i = 1;
			top = 0;
		}
	}
	
	return(0);
	
}

Compiler output:
main.c: In function 'main':
main.c:46:42: error: implicit declaration of function 'returnsname' [-Wimplicit-function-declaration]
   46 |                         printf("%c %d\n",returnsname(topn),top);
      |                                          ^~~~~~~~~~~
Language: C

#include<stdio.h>
int main(){
int a[5],x,y,max;
while(scanf("%d %d",&x,&y),x||y){
max=0;
a[0]=x+y;
for(i=1;i<5;i++){
scanf("%d %d",&x,&y);
a[i]=x+y;
}
for(i=0;i<5;i++)
if(max<a[i])
max=a[i];
for(i=0;i<5;i++)
if(a[i]==max)
printf("%c %d\n",'A'+i.max);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: 'i' undeclared (first use in this function)
    7 | for(i=1;i<5;i++){
      |     ^
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
int a[5],x,y,max,i;
while(scanf("%d %d",&x,&y),x||y){
max=0;
a[0]=x+y;
for(i=1;i<5;i++){
scanf("%d %d",&x,&y);
a[i]=x+y;
}
for(i=0;i<5;i++)
if(max<a[i])
max=a[i];
for(i=0;i<5;i++)
if(a[i]==max)
printf("%c %d\n",'A'+i.max);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:23: error: request for member 'max' in something not a structure or union
   16 | printf("%c %d\n",'A'+i.max);
      |                       ^
Language: C

include <stdio.h>

main(){
  int data[5];
  int i, max, a, b, ans;

  while(1){
    scanf("%d %d", &a, &b);
    if(a==0 && b==0) break;
    data[0]=a+b;

    for(i=1;i<5;i++){
      scanf("%d %d", &a, &b);
      data[i]=a+b;
    }

    max=-1;

    for(i=0;i<5;i++){
      if(max<data[i]){
	max=data[i];
	ans=i;
      }
    }

    printf("%c %d\n", ans+'A', max);
  }

  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>
int main(void){
  int a[5],s,b,c,d,e,f,g,h,i,j,k,l,n,m;
  j=0;
  a[5]=0;
  
  for(n=0;n<10;n++){
    
    scanf("%d %d",&b,&c);
    scanf("%d %d",&d,&e);
    scanf("%d %d",&f,&g);
    scanf("%d %d",&h,&k);
    scanf("%d %d",&l,&m);
    
    a[0]=b+c;
    a[1]=d+e;
    a[2]=f+g;
    a[3]=h+k;
    a[4]=l+m;
    
    
    for(i=0;i<5;i++){
      
      for(j=i+1;j<5;j++){
	
	if(a[i]<a[j])
	  t=a[i];
	a[i]=a[j];
	a[j]=a[i];
      }
    }
    printf("%d",a[0]);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:11: error: 't' undeclared (first use in this function)
   27 |           t=a[i];
      |           ^
main.c:27:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void) {
	int gozen,gogo;
	int kazu[5];
	int maxmise;
	int maxkazu;
	int i;
	while(1) {
		scanf("%d %d",&gozen,&gogo);
		if(gozen==0 && gogo==)break;
		kazu[0]=gozen+gogo;
		for(i=1;i<5;i++) {
			scanf("%d %d",&gozen,&gogo);
			kazu[i]=gozen+gogo;
		}
		maxmise=0;
		maxkazu=kazu[0];
		for(i=0;i<5;i++) {
			if(kazu[i]>maxkazu) {
				maxkazu=kazu[i];
				maxmise=i;
			}
		}
		printf("%c %d\n",'A'+maxmise,maxkazu);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:38: error: expected expression before ')' token
   11 |                 if(gozen==0 && gogo==)break;
      |                                      ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int shop[5];
	char ans;int answer;
	
	
	while(true){
		int s1,s2;
		cin>>s1>>s2;
		if(s1==0&&s2==0)break;
		shop[0]=s1+s2;
		
	for(int i=1;i<5;i++){
		cin>>s1>>s2;
		shop[i]=s1+s2;
	}
	for(int i=0;i<5;i++)cout<<shop[i]<<endl;
	answer=0
	for(int i=0;i<5;i++){
	answer=max(shop[i],answer);
	}
	if(answer==shop[0])ans='A';
	if(answer==shop[1])ans='B';
	if(answer==shop[2])ans='C';
	if(answer==shop[3])ans='D';
	if(answer==shop[4])ans='E';
	
	cout<<ans<<" "<<answer<<endl;
}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: expected ';' before 'for'
   20 |         answer=0
      |                 ^
      |                 ;
   21 |         for(int i=0;i<5;i++){
      |         ~~~      
a.cc:21:21: error: 'i' was not declared in this scope
   21 |         for(int i=0;i<5;i++){
      |                     ^
Language: C++

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

int main(){
  pair<int,char>shop[5];
  int am[5],pm[5];

  while(1){
    cin >> am[0] >> pm[0];
    if(am[0] == 0 && pm[0] == 0)break;

    for(int i=1;i<5;i++){
      cin >> am[i] >> pm[i];
    }
    
    for(int i=0;i<5;i++){
      shop[i].first = am[i] + pm[i];
      shop[i].second = 'A' + i;
    }
  
    sort(shop,shop+5);

    cout << shop[4].second << ' ' << shop[4].first << endl;
  }
  return 0;
}

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

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

int main(){
  pair<int,char> shop[5];
  int am[5],pm[5];

  while(1){
    cin >> am[0] >> pm[0];
    if(am[0] == 0 && pm[0] == 0)break;

    for(int i=1;i<5;i++){
      cin >> am[i] >> pm[i];
    }
    
    for(int i=0;i<5;i++){
      shop[i].first = am[i] + pm[i];
      shop[i].second = 'A' + i;
    }
  
    sort(shop,shop+5);

    cout << shop[4].second << ' ' << shop[4].first << endl;
  }
  return 0;
}

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

#include<stdio>
int main(void)
{
    int a[5],b[5];
	int i,max,sum[5];
	char c2,c[5]={'A','B','C','D','E'};
	while (scanf("%d %d",&a[0],&b[0])!=EOF){
	    if(a[0]==0&&b[0]==0) break;
		sum[0]=a[0]+b[0];
		max=sum[0];
		c2='A';
		for(i=1;i<5;i++){
		    scanf("%d %d",&a[i],&b[i]);
			sum[i]=a[i]+b[i];
		}
		for(i=0;i<5;i++){
            if(max<=sum[i]){
			    max=sum[i];
				c2=c[i];
			}
		}
		printf("%c %d\n",c2,max);
	}
	return 0
}
			
		

Compiler output:
a.cc:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<stdio>
int main(void)
{
    int a[5],b[5];
	int i,max,sum[5];
	char c2,c[5]={'A','B','C','D','E'};
	while (scanf("%d %d",&a[0],&b[0])!=EOF){
	    if(a[0]==0&&b[0]==0) break;
		sum[0]=a[0]+b[0];
		max=sum[0];
		c2='A';
		for(i=1;i<5;i++){
		    scanf("%d %d",&a[i],&b[i]);
			sum[i]=a[i]+b[i];
		}
		for(i=0;i<5;i++){
            if(max<sum[i]){
			    max=sum[i];
				c2=c[i];
			}
		}
		printf("%c %d\n",c2,max);
	}
	return 0
}
			
		

Compiler output:
a.cc:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	enum tol { a, b, c, d, e };
	vector<tol>l;
	vector<int>ll;
	int a1, a2;
	while (cin >> a1 >> a2){
		if (a1 == 0 && a2 == 0)break;
		int o[5];
		int oo[5];
		a1 += a2;
		o[0] = a1;
		for (int i = 1; i < 5; i++) {
			cin >> a1 >> a2;
			a1 += a2;
			o[i] = a1;
		}
		for (int i = 0; i < 5; i++)oo[i] = o[i];
		sort(oo, oo + 5);
		if (oo[4] == o[0]) {
			l.push_back(a);
			ll.push_back(o[0];)
		}
		else if (oo[4] == o[1]) {
			l.push_back(b); 
			ll.push_back(o[1]);
		}
		else if (oo[4] == o[2]) { 
			l.push_back(c); 
			ll.push_back(o[2]);
		}
		else if (oo[4] == o[3]) { 
			l.push_back(d);
			ll.push_back(o[3]);
		}
		else if (oo[4] == o[4]) {
			l.push_back(e);
			ll.push_back(o[4]);
		}
	}
	for (int p = 0; p < l.size();p++){
		if (l[p] == a)cout << "A";
		else if (l[p] == b)cout << "B";
		else if (l[p] == c)cout << "C";
		else if (l[p] == d)cout << "D";
		else if (l[p] == e)cout << "E";
		cout << ' ' << ll[p] << endl;
		cout << endl;
	}
	char ch;
	cin >> ch;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:42: error: expected ')' before ';' token
   25 |                         ll.push_back(o[0];)
      |                                     ~    ^
      |                                          )
a.cc:25:43: error: expected primary-expression before ')' token
   25 |                         ll.push_back(o[0];)
      |                                           ^
Language: C++

#include<iostream>
using namespace std;
int main() {
int s,a,d,c;
while(cin>>a>>d,a)) {
s=a+d;c=0;
for(int i=1;i<5;i++) {
cin>>a>>d;
if(s<a+d)s=a+d,c=i;
}
cout<<(char)(c+'A')<<' '<<s<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected primary-expression before ')' token
    5 | while(cin>>a>>d,a)) {
      |                   ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(void)
{
	int a[5],b[5],d,i,j;
	char c[5]="ABCDE";
	scanf("%d %d",&a[0],&b[0]);
	while(a[i]!=0 || b[i]!=0){
		d=0; j=0;
		for(i=1;i<5;i++){
			scanf("%d %d",&a[i],&b[i]);
			if(a[i]+b[i]>d){
				d=a[i]+b[i]; j=i;
			}
		}
		printf("%c %d\n",c[j],d);
		i=0;
		scanf("% %d",&a[i],&b[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: initializer-string for 'char [5]' is too long [-fpermissive]
    6 |         char c[5]="ABCDE";
      |                   ^~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(void)
{
	int a[5],b[5],d,i,j;
	char c[5]="ABCDE";
	scanf("%d %d",&a[0],&b[0]);
	while(a[i]!=0 || b[i]!=0){
		j=0; d=0;
		if(a[i]+b[i]>d){
			d=a[i]+b[i]; j=i;
		}
		for(i=1;i<5;i++){
			scanf("%d %d",&a[i],&b[i]);
			if(a[i]+b[i]>d){
				d=a[i]+b[i]; j=i;
			}
		}
		printf("%c %d\n",c[j],d);
		i=0;
		scanf("% %d",&a[i],&b[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: initializer-string for 'char [5]' is too long [-fpermissive]
    6 |         char c[5]="ABCDE";
      |                   ^~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(void)
{
	int a[5],b[5],d,i,j;
	char c[5]="ABCDE";
	scanf("%d %d",&a[0],&b[0]);
	while(a[0]!=0 || b[0]!=0){
		j=0; d=a[0]+b[0];
		for(i=1;i<5;i++){
			scanf("%d %d",&a[i],&b[i]);
			if(a[i]+b[i]>d){
				d=a[i]+b[i]; j=i;
			}
		}
		printf("%c %d\n",c[j],d);
		scanf("% %d",&a[0],&b[0]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: initializer-string for 'char [5]' is too long [-fpermissive]
    6 |         char c[5]="ABCDE";
      |                   ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int GetMaxs(int date[], int n){
	int max=0, maxn=0;
	for(int i=0; i<n; i++){
		if(max<date[i]){
			max = date[i];
			maxn = i;
		}
	}
	return (maxn);
}

int main(void){
	int m[5],am,pm;
	string s;
	while(cin>>am>>pm,am){
		m[0] = am + pm;
		for(int i=1; i<5; i++){
			cin>>am>>pm;
			m[i] = am + pm;
		}
		s = 'A' + GetMaxs(m,5);
		cout << s << " " << date[Getmax(m,5)] <<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:37: error: 'date' was not declared in this scope
   25 |                 cout << s << " " << date[Getmax(m,5)] <<endl;
      |                                     ^~~~
a.cc:25:42: error: 'Getmax' was not declared in this scope; did you mean 'GetMaxs'?
   25 |                 cout << s << " " << date[Getmax(m,5)] <<endl;
      |                                          ^~~~~~
      |                                          GetMaxs
Language: C

#include <stdio.h>
int struct a{
  char name;
  int score[10],win,lose;
};
int main(){
  int n,j,i,top=0,b,con=0;
  while(1){
    scanf("%d",&n);
    if(n==0) break;
    struct a p[10];
    for(i=0;i<n;i++){
      p[i].win=0;
      p[i].lose=0;
      scanf("%c",&p[i].name);
      for(j=0;j<n-1;j++){
	scanf("%d",&p[i].score[j]);
	if(p[i].score[j]==0) p[i].win+=1;
	else if(p[i].score[j]==1) p[i].lose+=1;                                                       
      }
    }
    for(i=0;i<n;i++){

      b=-1;
      for(j=0;j<n;j++){
	if(top<p[j].win){
	  top=p[j].win;
	  con=j;
	}
	else if((top=p[j].win&&b>p[j].lose)||(top=p[j].win&&b>-1)){
	  b=p[j].lose;
	  con=j;
	}
      }
      printf("%c\n",p[con].name);
      p[con].win=-1;
      for(j=0;j<n;j++){
	if(p[j].win!=-1){
	  top=p[j].win;
	  con=j;
	  break;
	}
      }

    }
  } 
  return 0; 
}

Compiler output:
main.c:2:5: error: two or more data types in declaration specifiers
    2 | int struct a{
      |     ^~~~~~
main.c:5:1: warning: useless type name in empty declaration
    5 | };
      | ^
Language: C

main(){
  while(1){
  int n,j,i,top=0,b,con=0;
    scanf("%d",&n);
    if(n==0) break;
    struct a p[10];
    for(i=0;i<n;i++){
      p[i].win=0;
      p[i].lose=0;
      scanf("%s",p[i].name);
      for(j=0;j<n-1;j++){
	scanf("%d",&p[i].score[j]);
	if(p[i].score[j]==0) p[i].win+=1;
	else if(p[i].score[j]==1) p[i].lose+=1; 
      }
    }

    for(i=0;i<n;i++){
      b=100;
      for(j=n-1;j>=0;j--){
	if(top<p[j].win){
	  top=p[j].win;
	  con=j;
	}
	else if((top==p[j].win&&b>p[j].lose)||(top==p[j].win&&b==100)){
	  b=p[j].lose;
	  con=j;
	}
      }
      printf("%s\n",p[con].name);
      p[con].win=-1;
      for(j=0;j<n;j++){
	if(p[j].win!=-1){
	  top=p[j].win;
	  con=j;
	  break;
	}
      }

    }
  } 
  return 0; 
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |     scanf("%d",&n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:4:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |     scanf("%d",&n);
      |     ^~~~~
main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:14: error: array type has incomplete element type 'struct a'
    6 |     struct a p[10];
      |              ^
main.c:30:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   30 |       printf("%s\n",p[con].name);
      |       ^~~~~~
main.c:30:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:30:7: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

   1. #include <iostream>  
   2. using namespace std;  
   3.   
   4. int main()  
   5. {  
   6.     int n;  
   7.     while (cin >> n, n)  
   8.     {  
   9.         char name[10];  
  10.         int win[10] = {0};  
  11.         int lose[10] = {0};  
  12.   
  13.         for (int i = 0; i < n; i++)  
  14.         {  
  15.             cin >> name[i];  
  16.             for (int j = 0; j < n - 1; j++)  
  17.             {  
  18.                 int s;  
  19.                 cin >> s;  
  20.                 if (s == 0)  
  21.                     win[i]++;  
  22.                 if (s == 1)  
  23.                     lose[i]++;  
  24.             }  
  25.         }  
  26.   
  27.         for (int i = n - 1; i > -1; i--)  
  28.             for (int j = 0; j < n - i; j++)  
  29.                 for (int k = 0; k < n; k++)  
  30.                     if (win[k] == i && lose[k] == j)  
  31.                         cout << name[k] << endl;  
  32.   
  33.     }  
  34.   
  35.     return 0;  
  36. }  

Compiler output:
main.c:1:4: error: expected identifier or '(' before numeric constant
    1 |    1. #include <iostream>
      |    ^~
main.c:1:7: error: stray '#' in program
    1 |    1. #include <iostream>
      |       ^
main.c:3:4: error: expected identifier or '(' before numeric constant
    3 |    3.
      |    ^~
Language: C

#include <iostream>
#include <cstdio>

using namespace std;
int i,j,make[100],kati[100];
char name[100];

void change(){
  int tmp1,tmp2;
  char tmp3;
  tmp1 = kati[i];
  kati[i] = kati[j];
  kati[j] = tmp1;
  
  tmp2 = make[i];
  make[i] = make[j];
  make[j] = tmp2;
  
  tmp3 = name[i];
  name[i] = name[j];
  name[j] = tmp3;
}

int main(){
  int n,s;
  while(1){
    cin >> n;
    if( n == 0 )break;
    for( i = 0;i < n ; i++){
      kati[i] = 0;
      make[i] = 0;
    }
    
    for( i = 0 ; i < n ; i++ ){
	cin >> name[i];
      for( j = 0; j < n-1 ; j++ ){
	cin >> s;
	if(s == 0)kati[i]++;
	if(s == 1)make[i]++;
      }
    }

    for( i = 0; i < n-1 ; i++){
      for( j = i+1; j < n ; j++){
	if(kati[i] < kati[j] ){
	  change();
      }
      }
    }
    //     for(i = 0;i < n ;i++)cout << name[i] << endl;

         for( i = 0; i < n-1 ; i++){
      for( j = i+1; j < n ; j++){

	if(( kati[i]==kati[j] )&&( make[i] > make[j] )){
	    change();
	  }
      }
      }
    
     for(i = 0;i < n ;i++)cout << name[i] << 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<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<iostream>
using namespace std;
int main(void)
{
	char name[10];
	int toku[9][5],n,make,hiki,sum[9],touroku[9];
	int flg[9];
	while(1) {
		cin>>n;
		if(n==0) break;
		for(int i=0;i<n;i++) {
			cin>>name[i];
			for(int j=0;j<n-1;j++) {
				cin>>toku[i][j];
			}
		}
		for(int i=0;i<n;i++) {sum[i]=0;touroku[i]=0;}
		for(int i=0;i<n;i++) {
			kati=0;make=0;
			for(int j=0;j<n-1;j++) {
				if(toku[i][j]==0) kati++;
				if(toku[i][j]==1) make++;
			}
			sum[i]=kati+(make*-1);
		}
		for(int i=0;i<n;i++) touroku[i]=sum[i];
		sort(sum,sum+n,greater<int>());
		for(int i=0;i<n;i++) flg[i]=0;
		for(int i=0;i<n;i++) {
			for(int j=0;j<n;j++) {
				if(sum[i]==touroku[j] && flg[j]==0) {
					cout<<name[j]<<endl;
					flg[j]=1;
					break;
				}
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: 'kati' was not declared in this scope
   26 |                         kati=0;make=0;
      |                         ^~~~
Language: C++

#include<stdio.h>
int main(void)
{
    int n,i,j,a[10][9],b[10],w,flg[10];
	char name[10],x;
	while(1){
	    scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<n;i++){
		    scanf(" %c",&name[i]);
			for(j=0;j<n-1;j++){
			    scanf(" %d",&a[i][j]);
			}
		}
		for(i=0;i<n;i++) b[i]=0,flg=i;
		for(i=0;i<n;i++){
		    for(j=0;j<n-1;j++){
			    if(a[i][j]==0) b[i]=b[i]+10;
				else if(a[i][j]==2) b[i]=b[i]+1;
			}
		}	
		for(i=0;i<n-1;i++){
		    for(j=i+1;j<n;j++){
			    if(b[i]<b[j]){
				    w=b[i];
					b[i]=b[j];
					b[j]=w;
					x=name[i];
					name[i]=name[j];
					name[j]=x;
					w=flg[i];
					flg[i]=flg[j];
					flg[j]=w;
				}
			}
		}
		for(i=0;i<n-1;i++){
		    if(b[i]==b[i+1]&&flg[i]>flg[i+1]){
			    	w=b[i];
					b[i]=b[i+1];
					b[i+1]=w;
					x=name[i];
					name[i]=name[i+1];
					name[i+1]=x;
					w=flg[i];
					flg[i]=flg[i+1];
					flg[i+1]=w;
		}
		for(i=0;i<n;i++) printf("%c\n",name[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:44: error: incompatible types in assignment of 'int' to 'int [10]'
   15 |                 for(i=0;i<n;i++) b[i]=0,flg=i;
      |                                         ~~~^~
a.cc:52:2: error: expected '}' at end of input
   52 | }
      |  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<char,pair<int,int> > p;
int main() {
	int n;
	while(cin>>n,n){
		vector<p>a;
		for(int i=0;i<n;i++){
			p data;cin>>data.first;
			data.second.first=0;
			data.second.second=0;
			for(int j=0;j<n-1;j++){
				int p;cin>>p;
				if(p==0)data.second.first++;
				else if(p==1)data.second.second++;
			}
			a.push_back(data);
		}
		for(int i=0;i<n;i++){
			int f=0;
			for(int j=1;j<a.size();j++){
				if(a[j].second.first>a[f].second.first)f=j;
				else if(a[j].second.first==a[f].second.first&&a[j].second.first<a[f].second.first)f=j;
			}
			cout<<a[f].first<<endl;
			v.erase(v.begin()+f);
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: 'v' was not declared in this scope
   26 |                         v.erase(v.begin()+f);
      |                         ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class team
{
	public:

		team(){c=w=l=0;}

		char c;
		int w,l;

		operator<(const team& t) const
		{
			return w!=t.w ? w>t.w : l<t.l;
		}
};

int main()
{
	int n,s;
	while(cin >> n, n)
	{
		vector<team> v;

		for(int j=0; j<n; j++)
		{
			team t;
			cin >> t.c;

			for(int i=0; i<n-1; i++)
			{
				cin >> s;
				if(s==0) { t.w++; }
				if(s==1) { t.l++; }
			}
			v.push_back(t);
		}
		stable_sort(v.begin(), v.end());
		for(int i=0; i<v.size(); i++)
		{
			cout << v[i].c << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:15:17: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   15 |                 operator<(const team& t) const
      |                 ^~~~~~~~
Language: C++

include<iostream>
#include<cstdlib>
#define MAX 10

using namespace std;

struct datum {
	char name;
	int win;
	int lose;
};

datum data[MAX];

int compare ( const void * a, const void * b ) {
	const datum x = *((datum*)a);
	const datum y = *((datum*)b);

	if ( x.win == y.win )
		return x.lose - y.lose;
	return y.win - x.win;
}

int main () {

	while ( true ) {
		int n;
		cin >> n;
		if ( n == 0 )
			break;
		for ( int i=0; i<n; i++ ) {
			cin >> data[i].name;
			int win, lose;
			win = 0;
			lose = 0;
			int now;
			for ( int j=0; j<n-1; j++ ) {
				cin >> now ;
				if ( now == 0 )
					win++;
				if ( now == 1 )
					lose++;
			}
			data[i].win = win;
			data[i].lose = lose;
		}

		qsort ( data, n, sizeof(datum), compare);

		for ( int i=0; i<n; i++ ) {
			cout << data[i].name << endl;
		}
	}
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:28:17: error: 'cin' was not declared in this scope
   28 |                 cin >> n;
      |                 ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<cstdlib>
  +++ |+#include <iostream>
    3 | #define MAX 10
a.cc:51:25: error: 'cout' was not declared in this scope
   51 |                         cout << data[i].name << endl;
      |                         ^~~~
a.cc:51:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:51:49: error: 'endl' was not declared in this scope
   51 |                         cout << data[i].name << endl;
      |                                                 ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<cstdlib>
  +++ |+#include <ostream>
    3 | #define MAX 10
Language: C++

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

bool hikaku(const pair<int,string>& A,const pair<int,string>& B){
	return A.first > B.first;
}
int main(){
	int n,k,win,lose,les;
	string s;
	
	while(cin >> n,n){
		vector<pair<int,string> >p; // vector < pair <string, int> >p;
	
		for(int i=0;i<n;i++){
			cin >> s ;// cin >> s;
			les = 0;
			for(int j=0;j<n-1;j++){
				cin >> k;
				if(k==0)
				les+=10;//les++;
				if(k==2)//if(k==1)
				les+=1;
			}
			p.push_back( make_pair(les,s) );
		}
		stable_sort(p.begin(),p.end(),hikaku );
		//stable_sprt(p.begin(),p.end(),greater<pair<string , int> >);
		for(int i=0;i<n;i++)c
		cout << p[i].second<<endl;
		
	}
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:37: error: 'c' was not declared in this scope
   32 |                 for(int i=0;i<n;i++)c
      |                                     ^
Language: C++

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

int main(){
	int n;
	while(cin >> n && n){
		vector<string> a;
		vector< pair<int,int> > v;
		for(int i = 0 ; i < n ; i++){
			string name;
			cin >> name;
			a.push_back(name);
			int w = 0;
			for(int j = 0 ; j < n - 1 ; j++){
				int t;
				cin >> t;
				if( t == 0 ) w += 10000;
				if( t == 2 ) w += 1;
			}
			v.push_back(make_pair(-w,i));
		}
		sort(v.begin(),v.end());
		for(int i = 0 ; i < v.size() ; i++){
			cout << a[v[i].second] << endl;
		}
	}
	
}

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

#include <iostream>
using namespace std;

int main(){
  int n;

  while(cin >> n){
    if(n == 0){
      break;
    }

    pair<pair<int,int>,pair<int,char> > t[n];

    for(int i = 0; i < n; i++){
      t[i].second.first = i;
      cin >> t[i].second.second;

      t[i].first.first = 0;
      t[i].first.second = 0;

      for(int j = 0; j < n - 1; j++){
        int x;
        cin >> x;

        if(x == 0) t[i].first.first--;
        else if(x == 1) t[i].first.second++;
      }
    }

    sort(t, t + n);

    for(int i = 0; i < n; i++){
      cout << t[i].second.second << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |     sort(t, t + n);
      |     ^~~~
      |     short
Language: C++

#include<iostream>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,string> PP;
int n,m;
PP t[10];
int main(){
  while(cin>>n&&n){
    for(int i=0;i<n;i++){
      cin>>t[i].second;
      t[i].first.first=t[i].first.second=0;
      for(int j=0;j<n;j++){
	if(i==j)continue;
	cin>>m;
	if(m==0)t[i].first.first--;
	else if(m==1)t[i].first.second++;
      }
    }
    sort(t,t+n);
    for(int i=0;i<n;i++){cout<<t[i].second<<endl; 
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |     sort(t,t+n);
      |     ^~~~
      |     short
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,string> PP;
int n,m;
PP t[10];
int main(){
  while(cin>>n&&n){
    for(int i=0;i<n;i++){
      cin>>t[i].second;
      t[i].first.first=t[i].first.second=0;
      for(int j=0;j<n;j++){
	if(i==j)continue;
	cin>>m;
	if(m==0)t[i].first.first--;
	else if(m==1)t[i].first.second++;
      }
    }
    sort(t,t+n);
    for(int i=0;i<n;i++){cout<<t[i].second<<endl; 
  }
  return 0;
}

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

#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
double dp[200][100];//動的計画法
int main(){
    int a,b,cnt,tmp;
    while(cin>>a>>b,a){
        cnt=0;
        while(b){
            a%=b;
            tmp=b;
            b=a;
            a=tmp;
            cnt++;
        }
        cout<<a<<" "<<cnt<<endl;
    }
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<climits>
^
Main.java:3: error: illegal character: '#'
#include<math.h>
^
Main.java:4: error: illegal character: '#'
#include<vector>
^
Main.java:5: error: illegal character: '#'
#include<algorithm>
^
Main.java:6: error: illegal character: '#'
#include<cstdio>
^
Main.java:7: error: illegal character: '#'
#include <string>
^
Main.java:8: error: illegal character: '#'
#include <complex>
^
Main.java:9: error: illegal character: '#'
#include <functional>
^
Main.java:11: error: class, interface, enum, or record expected
typedef pair<int,int> P;
^
Main.java:12: error: class, interface, enum, or record expected
double dat[100][100];
^
Main.java:13: error: class, interface, enum, or record expected
double dp[200][100];//?????
^
Main.java:16: error: not a statement
    while(cin>>a>>b,a){
                    ^
Main.java:25: error: not a statement
        cout<<a<<" "<<cnt<<endl;
                         ^
Main.java:14: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:16: error: ')' expected
    while(cin>>a>>b,a){
                   ^
Main.java:16: error: ';' expected
    while(cin>>a>>b,a){
                     ^
17 errors
Language: C

#include <stdio.h>
int main(void) {
	int  a1, a2, x, y;
	int amari,i=0;
	scanf("%d %d", &a1, &a2);	//1. 2number
	if(a1==0 && a2==0)break;
	if(a1<a2){
		
		x = a2;
		y = a1;
	}	
	for(i=0;amari =! 0;i++){
		amari = x % y;
		x = y;
		y = amari;
                	
	}
	
	printf("%d %d\n", x, i);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:27: error: break statement not within loop or switch
    6 |         if(a1==0 && a2==0)break;
      |                           ^~~~~
Language: C

#include <stdio.h>
int main(void) {
	int  a1, a2, x, y;
	int amari,i=0;
	scanf("%d %d", &a1, &a2);	//1. 2number
	if(a1==0 && a2==0) break;
	if(a1<a2){
		
		x = a2;
		y = a1;
	}	
	for(i=0;amari =! 0;i++){
		amari = x % y;
		x = y;
		y = amari;
                	
	}
	
	printf("%d %d\n", x, i);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:28: error: break statement not within loop or switch
    6 |         if(a1==0 && a2==0) break;
      |                            ^~~~~
Language: C

#include <stdio.h>
int main(void) {
    int x,y,i=0,a,amari;
    while (scanf("%d%d",&x,&y)!=EOF&&(x!=0||y!=0)) {
        if (x<y) {
            a=x;
            x=y;
            y=a;
        }
        while (y!=0) {
            x%=y;
            amari=x;
            x=y;
            y=amari;
            count++;
        }
        printf("%d %d\n",x,i);
    }
    return 0;
}





Compiler output:
main.c: In function 'main':
main.c:15:13: error: 'count' undeclared (first use in this function)
   15 |             count++;
      |             ^~~~~
main.c:15:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void) {
    int x,y,a,amari;
    while (scanf("%d%d",&x,&y)!=EOF&&(x!=0||y!=0)) {
        if (x<y) {
            a=x;
            x=y;
            y=a;
        }
	i = 0;
        while (y!=0) {
            x%=y;
            amari=x;
            x=y;
            y=amari;
            i++;
        }
        printf("%d %d\n",x,i);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'i' undeclared (first use in this function)
   10 |         i = 0;
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void) {
    int x,y,a,amari;
    while (scanf("%d%d",&x,&y)!=EOF&&(x!=0||y!=0)) {
        if (x<y) {
            a=x;
            x=y;
            y=a;
        }
	i = 0;
        while (y!=0) {
			amari = x % y; 
			x = y;
			y = amari;
            i++;
        }
        printf("%d %d\n",x,i);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'i' undeclared (first use in this function)
   10 |         i = 0;
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int i,l,a,x,b,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &a, &b);
      if(a == 0 && b == 0) break;
      if(a < b){  //chage
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(l = 0; b != 0; l++){ //keisan
      amari = a%b;
      a = b;
      b = amari;
      num++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: 'y' undeclared (first use in this function)
    8 |       a = y;
      |           ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int i,j,a,x,b,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &a, &b);
      if(a == 0 && b == 0) break;
      if(a < b){  //chage
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(j = 0; y != 0; j++){ //keisan
      amari = a%b;
      x = y;
      y = amari;
      j++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: 'y' undeclared (first use in this function)
    8 |       a = y;
      |           ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int i,j,a,x,b,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &a, &b);
      if(a == 0 && b == 0) break;
      if(a < b){ 
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(j = 0; y != 0; j++){ 
      amari = a%b;
      x = y;
      y = amari;
      j++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: 'y' undeclared (first use in this function)
    8 |       a = y;
      |           ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in