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

#include <iostream>
#include <cmath>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
#define EPS 1e-10
using namespace std;

int N, M[51], X[51][10], Y[51][10];

int len(int i, int j) {
  return abs(X[i][j] - X[i][j + 1]) + abs(Y[i][j] - Y[i][j + 1]);
}

int dir(int i, int j) {
  int x1 = X[i][j + 1] - X[i][j];
  int y1 = Y[i][j + 1] - Y[i][j];
  int x2 = X[i][j + 2] - X[i][j];
  int y2 = Y[i][j + 2] - Y[i][j];
  double r = atan2(x2, y2) - atan2(x1, y1);
  if(r < M_PI) r += M_PI * 2;
  if(r > M_PI) r -= M_PI * 2;
  if(abs(r) < EPS) return 0;
  return r > 0;
}

int main(void) {
  while(cin >> N, N) {
    REP(i, 0, N + 1) {
      cin >> M[i];
      REP(j, 0, M[i]) cin >> X[i][j] >> Y[i][j];
    }

    REP(i, 1, N + 1) {
      if(M[0] != M[i]) continue;
      bool f1 = true;
      REP(j, 0, M[0] - 1) if(len(0, j) != len(i, j)) f1 = false;
      REP(j, 0, M[0] - 2) if(dir(0, j) != dir(i, j)) f1 = false;
      bool f2 = true;
      reverse(X[i], X[i] + M[0]);
      reverse(Y[i], Y[i] + M[0]);
      REP(j, 0, M[0] - 1) if(len(0, j) != len(i, j)) f2 = false;
      REP(j, 0, M[0] - 2) if(dir(0, j) != dir(i, j)) f2 = false;
      if(f1 || f2) cout << i << endl;
    }
    cout << "+++++" << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:7: error: 'reverse' was not declared in this scope
   38 |       reverse(X[i], X[i] + M[0]);
      |       ^~~~~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

string encode() {
    int m;
    cin >> m;
    int x, y;
    cin >> x >> y;
    string s = "";
    int dirx = 0;
    int diry = 0;
    for (int i = 1; i < m; ++i) {
        int dx, dy;
        cin >> dx >> dy;
        dx -= x;
        dy -= y;

        int dist = abs(dx + dy);
        int ndirx = (dx > 0) - (dx < 0);
        int ndiry = (dy > 0) - (dy < 0);

        if (dirx == 1 && ndiry == -1) s += 'r';
        else if (dirx == 1 && ndiry == 1) s += 'l';
        else if (dirx == -1 && ndiry == -1) s += 'l';
        else if (dirx == -1 && ndiry == 1) s += 'r';
        else if (diry == 1 && ndirx == -1) s += 'l';
        else if (diry == 1 && ndirx == 1) s += 'r';
        else if (diry == -1 && ndirx == -1) s += 'r';
        else if (diry == -1 && ndirx == 1) s += 'l';


        dirx = ndirx;
        diry = ndiry;
        x += dx;
        y += dy;

        s += to_string(dist);
    }
        //cout << s << endl;
    return s;
}

int main() {
    while (1) {
        int n;
        cin >> n;
        if (n == 0) break;
        string code = encode();
        string rev(code);
        reverse(rev.begin(), rev.end());
        for (int i = 0; i < rev.size(); ++i) {
            if (rev[i] == 'r' || rev[i] == 'l') rev[i] = rev[i] == 'r' ? 'l' : 'r';
        }

        //cout << code << endl;
        //cout << rev << endl << endl;
        for (int i = 1; i <= n; ++i) {
            string ancode = encode();
            if(ancode == code || ancode == rev) cout << i << endl;
        }
        cout << "+++++" << endl;
    }
}


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

#define I(X,C)\
X##xm=X##ym=9999,X##xM=X##yM=-9999;\
for(scanf("%d",&C),i=0;i<C;i++){\
  scanf("%d%d",X[i],X[i]+1);\
  if(X##xm>X[i][0])X##xm=X[i][0];\
  if(X##ym>X[i][1])X##ym=X[i][1];\
  if(X##xM<X[i][0])X##xM=X[i][0];\
  if(X##yM<X[i][1])X##yM=X[i][1];\
}for(i=0;i<C;i++)X[i][0]-=X##xm,X[i][1]-=X##ym;X##xM-=X##xm,X##yM-=X##ym;

m[10][2],x[10][2],z[10][2],zz[10][2];
rx[4][2]={{1,0},{0,-1},{-1,0},{0,1}};
ry[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
mv[4][2]={{0,0},{0,0},{0,0},{0,0}};

main(N,M,Z,t,i,j,k,mxm,mym,mxM,myM,zxm,zym,zxM,zyM){
  for(;scanf("%d",&N),N;puts("+++++")){
    I(z,Z)
    for(i=0;i<Z;i++)zz[Z-1-i][0]=z[i][0],zz[Z-1-i][1]=z[i][1];
    for(j=0;j<N;j++){
      I(m,M)
      if(M!=Z)continue;
      mv[1][0]=myM,mv[2][0]=mxM,mv[2][1]=myM,mv[3][1]=mxM;
      for(k=0;k<4;k++){
        for(i=0;i<M;i++)x[i][0]=rx[k][0]*m[i][0]+rx[k][1]*m[i][1]+mv[k][0],x[i][1]=ry[k][0]*m[i][0]+ry[k][1]*m[i][1]+mv[k][1];
        if(!memcmp(x,z,4*2*M)||!memcmp(x,zz,4*2*M))printf("%d\n",j+1),k=4;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc:11:1: error: 'm' does not name a type
   11 | m[10][2],x[10][2],z[10][2],zz[10][2];
      | ^
a.cc:12:1: error: 'rx' does not name a type
   12 | rx[4][2]={{1,0},{0,-1},{-1,0},{0,1}};
      | ^~
a.cc:13:1: error: 'ry' does not name a type
   13 | ry[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
      | ^~
a.cc:14:1: error: 'mv' does not name a type
   14 | mv[4][2]={{0,0},{0,0},{0,0},{0,0}};
      | ^~
a.cc:16:5: error: expected constructor, destructor, or type conversion before '(' token
   16 | main(N,M,Z,t,i,j,k,mxm,mym,mxM,myM,zxm,zym,zxM,zyM){
      |     ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <complex>

#define PI M_PI

using namespace std;

typedef complex<int> P;

struct l {
	int n;
	vector<P> p;
};

P rotate(P p, int n) {
	int x = p.real(), y = p.imag();

	return
		  n == 0 ? P(x,  y)
		: n == 1 ? P(-y, x)
		: n == 2 ? P(y,  -x)
		:          P(-x, -y)
		;
}

int main() {
	int n;
	while (cin >> n, n) {
		vector<l> lines(++n);

		for (int i = 0; i < n; ++i) {
			cin >> lines[i].n;
			for (int j = 0; j < lines[i].n; ++j) {
				int x, y;
				cin >> x >> y;
				lines[i].p.push_back( P(x, y) );
			}
		}

		vector<l> pattern(8);
		for (int i = 0; i < 4; ++i) {
			l new_line;
			for (int j = 0; j < lines[0].n; ++j)
				new_line.p.push_back( rotate(lines[0].p[j], i) );

			pattern[i+4] = pattern[i] = new_line;
			reverse( pattern[i+4].p.begin(), pattern[i+4].p.end() );
		}

		for (int i = 1; i < n; ++i) {
			if (lines[i].n != lines[0].n) continue;
			for (int j = 0; j < 8; ++j) {
				P d = pattern[j].p[0] - lines[i].p[0];
				bool same = true;
				for (int k = 1; k < lines[i].n; ++k)
					same &= lines[i].p[k] + d == pattern[j].p[k];

				if (same) {
					cout << i << endl;
					break;
				}
			}
		}

		cout << "+++++" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:25: error: 'reverse' was not declared in this scope
   49 |                         reverse( pattern[i+4].p.begin(), pattern[i+4].p.end() );
      |                         ^~~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <functional>
#include <complex>

using namespace std;

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

typedef int Element;
typedef complex<Element> Point;

Element dot(const Point& a, const Point& b){
  return (a.real() * b.real() + a.imag() * b.imag());
}

Element cross(const Point& a, const Point& b){
  return (a.real() * b.imag() - a.imag() * b.real());
}

int ccw(Point a, Point b, Point c){
  b -= a; c -= a;
  if(cross(b,c) > 0) return +1;    // counter clock wise
  if(cross(b,c) < 0) return -1;    // clock wise
  if(dot(b,c) < 0) return +2;      // c--a--b
  if(norm(b) < norm(c)) return -2; // a--b--c
  return 0;                        // a--c--b || b == c
}

int main(){
  int N,M,i,j,x;
  vector< complex<Element> > origin;
  vector< complex<Element> > v[10];

  while(1){
    scanf("%d",&N);
    if(N == 0) break;
    scanf("%d",&M);
    origin.resize(M);
    REP(i,M) scanf("%d %d",&origin[i].real(),&origin[i].imag());
    REP(i,N){
      scanf("%d",&M);
      v[i].resize(M);
      REP(j,M) scanf("%d %d",&v[i][j].real(),&v[i][j].imag());
    }

    bool used[10];
    vector<int> res;
    REP(i,10) used[i] = false;
    REP(x,2) REP(i,N){
      bool same = true;
      if(x == 1) reverse(v[i].begin(),v[i].end());
      if(v[i].size() != origin.size()) continue;
      REP(j,origin.size()-1){
        if(abs(v[i][j].real() - v[i][j+1].real()) != abs(origin[j].real() - origin[j+1].real())) same = false;
        if(abs(v[i][j].imag() - v[i][j+1].imag()) != abs(origin[j].imag() - origin[j+1].imag())) same = false;
      }
      REP(j,origin.size()-2) if(ccw(v[i][j],v[i][j+1],v[i][j+2]) != ccw(origin[j],origin[j+1],origin[j+2])) same = false;
      if(same && !printed[i]){
        res.push_back(i+1);
        used[i] = true;
      }
    }

    sort(res.begin(),res.end());
    REP(i,res.size()) cout << res[i] << endl;
    cout << "+++++" << endl;    
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:43: error: lvalue required as unary '&' operand
   50 |     REP(i,M) scanf("%d %d",&origin[i].real(),&origin[i].imag());
      |                             ~~~~~~~~~~~~~~^~
a.cc:50:61: error: lvalue required as unary '&' operand
   50 |     REP(i,M) scanf("%d %d",&origin[i].real(),&origin[i].imag());
      |                                               ~~~~~~~~~~~~~~^~
a.cc:54:43: error: lvalue required as unary '&' operand
   54 |       REP(j,M) scanf("%d %d",&v[i][j].real(),&v[i][j].imag());
      |                               ~~~~~~~~~~~~^~
a.cc:54:59: error: lvalue required as unary '&' operand
   54 |       REP(j,M) scanf("%d %d",&v[i][j].real(),&v[i][j].imag());
      |                                               ~~~~~~~~~~~~^~
a.cc:69:19: error: 'printed' was not declared in this scope; did you mean 'printf'?
   69 |       if(same && !printed[i]){
      |                   ^~~~~~~
      |                   printf
Language: C++

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

#define pb push_back
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define sz size()

typedef complex<int> P;
typedef vector<P> V;

int n;

bool same(V a,V b){
	rep2(i,1,a.sz){
		if(a[i]-b[i]!=a[0]-b[0])return 0;
	}
	return 1;
}

int main(){
	while(cin>>n && n){
		V v;
		int m,x,y;
		cin>>m;
		rep(i,m){
			cin>>x>>y;
			v.pb(P(x,y));
		}
		rep(h,n){
			V w;
			cin>>m;
			rep(i,m){
				cin>>x>>y;
				w.pb(P(x,y));
			}
			if(m!=v.sz)continue;
			rep(i,2){
				rep(j,4){
					if(same(v,w)){
						cout<<h+1<<endl;
						goto out;
					}
					rep(k,m)w[k]=w[k]*P(0,1);
				}
				reverse(w.begin(),w.end());
			}
			out:;
		}
		cout<<"+++++\n";
	}
}

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

#include<complex>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-10
using namespace std;




typedef complex<int> P;
const double rad[4] ={0.0,M_PI/2,M_PI,-M_PI/2};
const int Sin[4] = {0,1,0,-1};
const int Cos[4] = {1,0,-1,0};

int main(){
  int n,m[110],x,y;
  double st,ed;
  P p[60][15];
  while(cin >> n && n){
    rep(i,n+1){
      cin >> m[i];
      rep(j,m[i]){
	cin >> x >> y; 
	p[i][j] = P(x,y);

	if(j == 1){
	  st = abs(p[i][j]-p[i][j-1]);//要潤
	}
	else if(j == m[i]-1)ed = abs(p[i][j]-p[i][j-1]);
      }

      if(st > ed){
	P sub = p[i][0];
	rep(j,m[i])p[i][j] -= sub;
      }
      else {
	P sub = p[i][m[i]-1];
	rep(j,m[i])p[i][j] -= sub;
	P h;
	rep(j,m[i]/2){
	  h = p[i][j];
	  p[i][j] = p[i][(m[i]-1)-j];
	  p[i][(m[i]-1)-j] = h;
	}
      }
      
      //if(i == 3){cout << "3晩M " << endl;
      //cout <<i << " --------------------" << endl;
      //rep(j,m[i])cout << p[i][j] << endl;
	//}

    }

    bool iso;

    //cout << "基準" << endl;
    //rep(i,m[0])cout << p[0][i] << endl;
    //cout << "基準" << endl;


    REP(i,1,n+1){
      if(m[i] != m[0])continue;
      //cout << i << "-------------------------" << endl;
      rep(j,4){
	iso = true;
	rep(k,m[0]){
	  P cp;
	  //cout <<"moto no p[i][k] = " << p[i][k] << "  ";
	
	  //cp = p[i][k]*polar(1.0,rad[j]);
	  cp.real() = p[i][k].real()*Cos[j]-p[i][k].imag()*Sin[j];
	  cp.imag() = p[i][k].real()*Sin[j]+p[i][k].imag()*Cos[j];
	

	  /*
	  cp.real() = p[i][k].real()*cos(rad[j])-p[i][k].imag()*sin(rad[j]);
	  cp.imag() = p[i][k].real()*sin(rad[j])+p[i][k].imag()*cos(rad[j]);
      */
	  //要潤
	  /*
	  //cout <<"pre cp = " << cp;
	  if(cp.real() > 0.0){
	    if(1.0-EPS>cp.real()-(int)cp.real()&&cp.real()-(int)cp.real() > 0.0){
	      cp.real() = (int)cp.real();
	    }
	  }
	  if(cp.imag() > 0.0){
	    if(1.0-EPS>cp.imag()-(int)cp.imag()&&cp.imag()-(int)cp.imag() > 0.0){
	      cp.imag() = (int)cp.imag();
	    }
	  }
	  if(cp.real() <0.0){
	    if(-1.0+EPS<cp.real()+(int)cp.real() && cp.real()+(int)cp.real() < 0.0){
	      cp.real() = (int)cp.real();
	    }
	  }
	  if(cp.imag() < 0.0){
	    if(-1.0+EPS< cp.imag()+(int)cp.imag() &&cp.imag()+(int)cp.imag() < 0.0){
	      cp.imag() = (int)cp.imag();
	    }
	  }
	  // cout << endl;
	  */
	  //要潤
	  //cout << j<< "th cp = " << cp  << "　基準 is " << p[0][k]<< endl;


	  //if(!(1.0-EPS>cp.real()-p[0][k].real()&&cp.real()-p[0][k].real()>=0.0-EPS&&1.0-EPS>cp.imag()-p[0][k].imag()&&cp.imag()-p[0][k].imag()>=0.0-EPS)){
	  //iso = false;
	  //break;
	  //} 


	  if(cp != p[0][k]){iso = false; break;}
	}
	
	if(iso)break;
      }
      if(iso)cout << i << endl;
    }
    cout <<"+++++" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:18: error: lvalue required as left operand of assignment
   75 |           cp.real() = p[i][k].real()*Cos[j]-p[i][k].imag()*Sin[j];
      |           ~~~~~~~^~
a.cc:76:18: error: lvalue required as left operand of assignment
   76 |           cp.imag() = p[i][k].real()*Sin[j]+p[i][k].imag()*Cos[j];
      |           ~~~~~~~^~
Language: C++

#include<complex>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-10
using namespace std;




typedef complex<int> P;
const double rad[4] ={0.0,M_PI/2,M_PI,-M_PI/2};
const int Sin[4] = {0,1,0,-1};
const int Cos[4] = {1,0,-1,0};

int main(){
  int n,m[110],x,y;
  double st,ed;
  P p[60][15];
  while(cin >> n && n){
    rep(i,n+1){
      cin >> m[i];
      rep(j,m[i]){
	cin >> x >> y; 
	p[i][j] = P(x,y);

	if(j == 1){
	  st = abs(p[i][j]-p[i][j-1]);//要潤
	}
	else if(j == m[i]-1)ed = abs(p[i][j]-p[i][j-1]);
      }

      if(st > ed){
	P sub = p[i][0];
	rep(j,m[i])p[i][j] -= sub;
      }
      else {
	P sub = p[i][m[i]-1];
	rep(j,m[i])p[i][j] -= sub;
	P h;
	rep(j,m[i]/2){
	  h = p[i][j];
	  p[i][j] = p[i][(m[i]-1)-j];
	  p[i][(m[i]-1)-j] = h;
	}
      }
      
      //if(i == 3){cout << "3晩M " << endl;
      //cout <<i << " --------------------" << endl;
      //rep(j,m[i])cout << p[i][j] << endl;
	//}

    }

    bool iso;

    //cout << "基準" << endl;
    //rep(i,m[0])cout << p[0][i] << endl;
    //cout << "基準" << endl;


    REP(i,1,n+1){
      if(m[i] != m[0])continue;
      //cout << i << "-------------------------" << endl;
      rep(j,4){
	iso = true;
	rep(k,m[0]){
	  P cp;
	  //cout <<"moto no p[i][k] = " << p[i][k] << "  ";
	
	  //cp = p[i][k]*polar(1.0,rad[j]);
	  cp.real() = (int)(p[i][k].real()*Cos[j]-p[i][k].imag()*Sin[j]);
	  cp.imag() = (int)(p[i][k].real()*Sin[j]+p[i][k].imag()*Cos[j]);
	

	  /*
	  cp.real() = p[i][k].real()*cos(rad[j])-p[i][k].imag()*sin(rad[j]);
	  cp.imag() = p[i][k].real()*sin(rad[j])+p[i][k].imag()*cos(rad[j]);
      */
	  //要潤
	  /*
	  //cout <<"pre cp = " << cp;
	  if(cp.real() > 0.0){
	    if(1.0-EPS>cp.real()-(int)cp.real()&&cp.real()-(int)cp.real() > 0.0){
	      cp.real() = (int)cp.real();
	    }
	  }
	  if(cp.imag() > 0.0){
	    if(1.0-EPS>cp.imag()-(int)cp.imag()&&cp.imag()-(int)cp.imag() > 0.0){
	      cp.imag() = (int)cp.imag();
	    }
	  }
	  if(cp.real() <0.0){
	    if(-1.0+EPS<cp.real()+(int)cp.real() && cp.real()+(int)cp.real() < 0.0){
	      cp.real() = (int)cp.real();
	    }
	  }
	  if(cp.imag() < 0.0){
	    if(-1.0+EPS< cp.imag()+(int)cp.imag() &&cp.imag()+(int)cp.imag() < 0.0){
	      cp.imag() = (int)cp.imag();
	    }
	  }
	  // cout << endl;
	  */
	  //要潤
	  //cout << j<< "th cp = " << cp  << "　基準 is " << p[0][k]<< endl;


	  //if(!(1.0-EPS>cp.real()-p[0][k].real()&&cp.real()-p[0][k].real()>=0.0-EPS&&1.0-EPS>cp.imag()-p[0][k].imag()&&cp.imag()-p[0][k].imag()>=0.0-EPS)){
	  //iso = false;
	  //break;
	  //} 


	  if(cp != p[0][k]){iso = false; break;}
	}
	
	if(iso)break;
      }
      if(iso)cout << i << endl;
    }
    cout <<"+++++" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:18: error: lvalue required as left operand of assignment
   75 |           cp.real() = (int)(p[i][k].real()*Cos[j]-p[i][k].imag()*Sin[j]);
      |           ~~~~~~~^~
a.cc:76:18: error: lvalue required as left operand of assignment
   76 |           cp.imag() = (int)(p[i][k].real()*Sin[j]+p[i][k].imag()*Cos[j]);
      |           ~~~~~~~^~
Language: C++

#include<complex>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-10
using namespace std;

typedef complex<int> P;
const double rad[4] ={0.0,M_PI/2,M_PI,-M_PI/2};
const int Sin[4] = {0,1,0,-1};
const int Cos[4] = {1,0,-1,0};

int main(){
  int n,m[110],x,y;
  double st,ed;
  P p[60][15];
  while(cin >> n && n){
    rep(i,n+1){
      cin >> m[i];
      rep(j,m[i]){
	cin >> x >> y; 
	p[i][j] = P(x,y);

	if(j == 1){
	  st = abs((double)(p[i][j]-p[i][j-1]));//要潤
	}
	else if(j == m[i]-1)ed = abs((double)(p[i][j]-p[i][j-1]));
      }

      if(st > ed){
	P sub = p[i][0];
	rep(j,m[i])p[i][j] -= sub;
      }
      else {
	P sub = p[i][m[i]-1];
	rep(j,m[i])p[i][j] -= sub;
	P h;
	rep(j,m[i]/2){
	  h = p[i][j];
	  p[i][j] = p[i][(m[i]-1)-j];
	  p[i][(m[i]-1)-j] = h;
	}
      } 
    }
    bool iso;
    REP(i,1,n+1){
      if(m[i] != m[0])continue;
  
      rep(j,4){
	iso = true;
	rep(k,m[0]){
	  P cp;

	  cp = P((int)(p[i][k].real()*Cos[j]-p[i][k].imag()*Sin[j]),(int)(p[i][k].real()*Sin[j]+p[i][k].imag()*Cos[j]));
		

	  if(cp != p[0][k]){iso = false; break;}
	}
	
	if(iso)break;
      }
      if(iso)cout << i << endl;
    }
    cout <<"+++++" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: invalid cast from type 'std::complex<int>' to type 'double'
   28 |           st = abs((double)(p[i][j]-p[i][j-1]));//要潤
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:38: error: invalid cast from type 'std::complex<int>' to type 'double'
   30 |         else if(j == m[i]-1)ed = abs((double)(p[i][j]-p[i][j-1]));
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<complex>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-10
using namespace std;

typedef complex<int> P;
const double rad[4] ={0.0,M_PI/2,M_PI,-M_PI/2};
const int Sin[4] = {0,1,0,-1};
const int Cos[4] = {1,0,-1,0};

int main(){
  int n,m[110],x,y;
  double st,ed;
  P p[60][15];
  while(cin >> n && n){
    rep(i,n+1){
      cin >> m[i];
      rep(j,m[i]){
	cin >> x >> y; 
	p[i][j] = P(x,y);

	if(j == 1){
	  st = (double)abs((int)(p[i][j]-p[i][j-1]));//要潤
	}
	else if(j == m[i]-1)ed = (double)abs((int)(p[i][j]-p[i][j-1]));
      }

      if(st > ed){
	P sub = p[i][0];
	rep(j,m[i])p[i][j] -= sub;
      }
      else {
	P sub = p[i][m[i]-1];
	rep(j,m[i])p[i][j] -= sub;
	P h;
	rep(j,m[i]/2){
	  h = p[i][j];
	  p[i][j] = p[i][(m[i]-1)-j];
	  p[i][(m[i]-1)-j] = h;
	}
      } 
    }
    bool iso;
    REP(i,1,n+1){
      if(m[i] != m[0])continue;
  
      rep(j,4){
	iso = true;
	rep(k,m[0]){
	  P cp;

	  cp = P((int)(p[i][k].real()*Cos[j]-p[i][k].imag()*Sin[j]),(int)(p[i][k].real()*Sin[j]+p[i][k].imag()*Cos[j]));
		

	  if(cp != p[0][k]){iso = false; break;}
	}
	
	if(iso)break;
      }
      if(iso)cout << i << endl;
    }
    cout <<"+++++" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:28: error: invalid cast from type 'std::complex<int>' to type 'int'
   28 |           st = (double)abs((int)(p[i][j]-p[i][j-1]));//要潤
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:46: error: invalid cast from type 'std::complex<int>' to type 'int'
   30 |         else if(j == m[i]-1)ed = (double)abs((int)(p[i][j]-p[i][j-1]));
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define pb push_back

struct Vector {
  int x, y;
  Vector() {}
  Vector(int x, int y) : x(x), y(y) {}
  
  double norm() {
    return x*x + y*y;
  }
  
  double abs() {
    return sqrt(x*x + y*y);
  }
};

typedef vector<Vector> vv;

Vector rotate90R(Vector v) {
  return Vector(-v.y, v.x);
}

int lcm(int a, int b) {
  return (a*b)/__gcd(a, b);
}

bool isEqVecs(vv vv1, vv vv2) {
  int a, b, l;
  l = lcm(vv1[0].norm(), vv2[0].norm());
  a = l / vv1[0].norm(); // テ・ツ?催ァツ篠?
  b = l / vv2[0].norm();
  
  if(vv1.size() != vv2.size()) return false; // テ」ツδ凖」ツつッテ」ツδ暗」ツδォテ」ツ?ョテヲツ閉ーテ」ツ?古ァツ閉ーテ」ツ?ェテ」ツつ?
  
  bool isok = true;
  // テヲツッツ氾ァツ篠?」ツ?古ッツシツ敕」ツ?凝ィツェツソテ」ツ?ケテ」ツつ?
  for(int i=0; i<vv1.size(); i++) {
    if(!(vv1[i].x * a == vv2[i].x * b
	 && vv1[i].y * a == vv2[i].y * b)) isok = false;
  }
  
  return isok;
}

int main() {
  int n;
  
  // input data
  while(cin >> n && n) {
    vv vvec[51][8];
    int id2m[51];
    Vector data[51];

    for(int id=0; id<=n; id++) {
      cin >> id2m[id];
      for(int j=0; j<id2m[id]; j++) {
	cin >> data[j].x >> data[j].y;
      }
      
      for(int j=1; j<id2m[id]; j++) {
	Vector V1(data[j].x-data[j-1].x, data[j].y-data[j-1].y);
	Vector V2(-(data[id2m[id]-1-j].x-data[id2m[id]-j].x), -(data[id2m[id]-1-j].y-data[id2m[id]-j].y));
	vvec[id][0].pb(V1);
	vvec[id][1].pb(rotate90R(vvec[id][0][j-1]));
	vvec[id][2].pb(rotate90R(vvec[id][1][j-1]));
	vvec[id][3].pb(rotate90R(vvec[id][2][j-1]));
	
	vvec[id][4].pb(V2);
	vvec[id][5].pb(rotate90R(vvec[id][4][j-1]));
	vvec[id][6].pb(rotate90R(vvec[id][5][j-1]));
	vvec[id][7].pb(rotate90R(vvec[id][6][j-1]));
      }
      
      /*
	for(int k=0; k<4; k++) {
	for(int v_i=0; v_i<id2m[id]-1; v_i++) {
	cout << vvec[id][k][v_i].x << ' ' << vvec[id][k][v_i].y << endl;
	}
	}
      */
    }
    
    for(int i=1; i<=n; i++) {
      // Obj(id = 0) テ」ツ?ィ Obj(for all except id = 0) * 8 テ」ツ?ィテ」ツ?ョテ、ツクツ?ィツ?エテ」ツつ津ィツェツソテ」ツ?ケテ」ツつ?
      for(int k=0; k<8; k++) {
	if(isEqVecs(vvec[i][k], vvec[0][0])) {
	  cout << i << endl;
	}
      }
    }
    cout << "+++++" << endl;
  }
    
  return 0;
}

Compiler output:
a.cc: In function 'int lcm(int, int)':
a.cc:29:16: error: '__gcd' was not declared in this scope
   29 |   return (a*b)/__gcd(a, b);
      |                ^~~~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int n,m;
	int s,t;
	int i,j,flag;
	vector<int> x,y,a,b,p,q;
	while(cin>>n,n){
		a.clear();
		b.clear();
		cin>>m;
		cin>>s>>t;
		a.push_back(s);
		b.push_back(t);
		for(i=0;i<m-1;i++){
			cin>>s>>t;
			a.push_back(s-a[0]);
			b.push_back(t-b[0]);
		}
		a[0]=a[0]-a[0];
		b[0]=b[0]-b[0];
		for(i=0;i<n;i++){
			cin>>m;
			flag=0;
			x.clear();
			y.clear();
			p.clear();
			q.clear();
			for(j=0;j<m;j++){
				cin>>s>>t;
				x.push_back(s);
			    y.push_back(t);
			}
			s=x[0];
			t=y[0];
			for(j=0;j<m;j++){
				p.push_back(x[j]-s);
			    q.push_back(y[j]-t);
			}
			for(int c=0;c<4;c++){
				for(j=0;j<m;j++){
					s=p[j];
					p[j]=-q[j];
					q[j]=s;
				}
				if(p==a&&q==b){
					cout<<i+1<<endl;
					flag=1;
					break;
				}
			}		
			if(flag){
				flag=0;
				continue;
			}
			reverse(x.begin(),x.end());
			reverse(y.begin(),y.end());
			for(j=0;j<m;j++){
				p[j]=x[j]-x[0];
			    q[j]=y[j]-y[0];
			}
			for(int c=0;c<4;c++){
				for(j=0;j<m;j++){
					s=p[j];
					p[j]=-q[j];
					q[j]=s;
				}
				if(p==a&&q==b){
					cout<<i+1<<endl;
					flag=1;
					break;
				}
			}
		}
		cout<<"+++++"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:25: error: 'reverse' was not declared in this scope
   60 |                         reverse(x.begin(),x.end());
      |                         ^~~~~~~
Language: Java

import java.util.*;
public class P1137 {
	Scanner sc;
	void run() { 
		sc = new Scanner(System.in);
		int n= sc.nextInt();
		for (int i=0;i<n;i++) {
			String str1 = sc.next();
			String str2 = sc.next();
			int num = str2Num(str1) + str2Num(str2);
			System.out.println(num2Str(num));
		}
	}
	
	int str2Num(String str) {
		int num=0;
		int tmp=1;
		for (int i=0;i<str.length();i++) {
			String a = "" + str.charAt(i);			
			if (a.compareTo("m")==0) {
				num += tmp * 1000;
				tmp = 1;
			}else if (a.compareTo("c")==0) {
				num += tmp * 100;
				tmp = 1;
			}else if (a.compareTo("x")==0) {
				num += tmp * 10;
				tmp = 1;
			}else if (a.compareTo("i")==0){
				num += tmp;
				tmp = 1;
			}else {
				tmp = Integer.parseInt(a);
			}
		}
		return num;
	}
	
	int[] ku = {1000,100,10,1};
	char[] c = {'m','c','x','i'};
	String num2Str(int num) {
		String str = "";
		for (int i=0;i<4;i++) {
			if (num / ku[i] > 0) {
				int tmp = num/ku[i];
				num = num - tmp*ku[i];
				if (tmp != 1) str += tmp;
				str += c[i];
			}
		}
		return str;
	}
	public static void main(String[] args) {
		new P1137().run();
	}
}

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


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

public class ProblemC
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		for (; N-->0; )
		{
			String x = sc.next(), y = sc.next();
			System.out.println(toString(toInt(x) + toInt(y)));
		}
	}
	
	private static int dd(char c)
	{
		switch (c)
		{
		case 'm': return 1000;
		case 'c': return 100;
		case 'x': return 10;
		case 'i': return 1;
		}
		return 0;
	}
	
	private static int toInt(String s)
	{
		int ret = 0;
		for (int i = 0; i < s.length(); )
		{
			char c = s.charAt(i++);
			int n = 1;
			if (Character.isDigit(c))
			{
				n = c - '0';
				c = s.charAt(i++);
			}
			ret += n * dd(c);
		}
		return ret;
	}
	
	private static String toString(int n)
	{
		int x;
		String ret = "";
		
		x = n % 10;
		ret = (x == 0 ? "" : (x == 1 ? "i" : x + "i")) + ret;
		n /= 10;
		
		x = n % 10;
		ret = (x == 0 ? "" : (x == 1 ? "x" : x + "x")) + ret;
		n /= 10;
		
		x = n % 10;
		ret = (x == 0 ? "" : (x == 1 ? "c" : x + "c")) + ret;
		n /= 10;
		
		x = n % 10;
		ret = (x == 0 ? "" : (x == 1 ? "m" : x + "m")) + ret;
		n /= 10;
		
		return ret;
	}
}
/*
10
xi x9i
i 9i
c2x2i 4c8x8i
m2ci 4m7c9x8i
9c9x9i i
i 9m9c9x8i
m i
i m
m9i i
9m8c7xi c2x8i
*/

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

import  java.util.Scanner;


public class Main {
	Scanner sc;
	private int parse( String mcxi ){
		boolean isNumEntered = false;
		int mk = 0;
		int ck = 0;
		int xk = 0;
		int ik = 0;
		int cur = 0;
		char[] cstr = mcxi.toCharArray();
		for( int i = 0; i < cstr.length; i++ ){
			switch( cstr[ i ] ){
				case 'm':
					mk = cur;
					if( !isNumEntered ){ mk = 1; }
					isNumEntered = false;
					break;
				case 'c':
					ck = cur;
					if( !isNumEntered ){ ck = 1; }
					isNumEntered = false;
					break;
				case 'x':
					xk = cur;
					if( !isNumEntered ){ xk = 1; }
					isNumEntered = false;
					break;
				case 'i':
					ik = cur;
					if( !isNumEntered ){ ik = 1; }
					isNumEntered = false;
					break;
				default:
					cur = cstr[ i ] - '0';
					isNumEntered = true;
					break;
			}
		}
		return mk * 1000 + ck * 100 + xk * 10 + ik;
	}

	private String getMcxi( int in ){
		int mk = in / 1000;
		in %= 1000;
		int ck = in / 100;
		in %= 100;
		int xk = in / 10;
		in %= 10;
		int ik = in;
		String r = "";
		if( mk >= 2 ){ r += mk; }
		if( mk >= 1 ){ r += "m"; }
		if( ck >= 2 ){ r += ck; }
		if( ck >= 1 ){ r += "c"; }
		if( xk >= 2 ){ r += xk; }
		if( xk >= 1 ){ r += "x"; }
		if( ik >= 2 ){ r += ik; }
		if( ik >= 1 ){ r += "i"; }
		return r;
	}

	private void run(){
		sc = new Scanner( System.in );
		int n = sc.nextInt();
		for( int i = 0; i < n; i++ ){
			System.out.println( getMcxi ( parse( sc.next() ) + parse( sc.next() ) ) );
		}
	}
	public static void main( String[] args ){
		new Main().run();
	}

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

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

public class p1136 {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String line;
			/* input */
			line = br.readLine();

			int n = Integer.parseInt(line);
			if(n==0) return;

			for(int k=0;k<n;k++){
				String ex[] = br.readLine().split(" ");
				String sum ="";
				int m=0,c=0,x=0,i=0;
				for(int j=0;j<=1;j++){
					int ii = ex[j].indexOf("i");
					if(ii>-1){
						if(ii==0){
							i += 1;
						} else {
							if(Character.isDigit(ex[j].charAt(ii-1))){
								i += Integer.parseInt(ex[j].substring(ii-1,ii));
							} else {
								i += 1;
							}
						}
					}
					if(i>=10){
						x += 1;
						i -= 10;
					}
					int xi = ex[j].indexOf("x");
					if(xi>-1){
						if(xi==0){
							x += 1;
							if(x>=10){
								c += 1;
								x -= 10;
							}
						} else {
							if(Character.isDigit(ex[j].charAt(xi-1))){
								x += Integer.parseInt(ex[j].substring(xi-1,xi));
							} else {
								x += 1;
							}
						}
					}
					if(x>=10){
						c += 1;
						x -= 10;
					}
					int ci = ex[j].indexOf("c");
					if(ci>-1){
						if(ci==0){
							c += 1;
						} else {
							if(Character.isDigit(ex[j].charAt(ci-1))){
								c += Integer.parseInt(ex[j].substring(ci-1,ci));
							} else {
								c += 1;
							}
						}
					}
					if(c>=10){
						m += 1;
						c -= 10;
					}
					int mi = ex[j].indexOf("m");
					if(mi>-1){
						if(mi==0){
							m += 1;
						} else {
							if(Character.isDigit(ex[j].charAt(mi-1))){
								m += Integer.parseInt(ex[j].substring(mi-1,mi));
							} else {
								m += 1;
							}
						}
					}
				}
				String ms = ((m==0)?"":(m==1)?"m":(m+"m"));
				String cs = ((c==0)?"":(c==1)?"c":(c+"c"));
				String xs = ((x==0)?"":(x==1)?"x":(x+"x"));
				String is = ((i==0)?"":(i==1)?"i":(i+"i"));
				sum = ms + cs + xs + is;
				System.out.println(sum);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

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

#include<stdio.h>
#include<ctype.h>

int main(void)
{
    int ans[4]={};
    int coef,k,c,formula;
    int i,j;

    scanf("%d%*c",&k);

    for(i=0;i<k;i++)
    {
        coef=1;
        formula=0;
        int scale[2][4]={};
        while(1)
        {
            scanf("%c",&c);
            if(c==10)
            {
                break;
            }
            if(isdigit(c))
            {
                coef=1;
            }
            else if(isalpha(c))
            {
                switch(c)
                {
                    case 'm':
                    scale[formula][3]+=coef;
                    break;
                    case 'c':
                    scale[formula][2]+=coef;
                    break;
                    case 'x':
                    scale[formula][1]+=coef;
                    break;
                    case 'i':
                    scale[formula][0]+=coef;
                    break;
                    default
                    break;
                }
            }
            else
            {
                formula=1;
            }
        }

        for(j=3;j>=0;j--)
        {
            int x=scale[0][j]+scale[1][j];
            ans[j]=x%10;
            ans[j+1]=x/10;
        }

        for(j=3;j>=0;j--)
        {
            if(ans[j]!=0)
            {
                if(ans[j]==1)
                {
                    switch(j)
                    {
                        case 0:
                        printf("i");
                        break;
                        case 1:
                        printf("x");
                        break;
                        case 2:
                        printf("c");
                        break;
                        case 3:
                        printf("m");
                        break;
                        default:
                        break;
                    }
                }
                else
                {
                    switch(j)
                    {
                        case 0:
                        printf("%di",ans[j]);
                        break;
                        case 1:
                        printf("%dx",ans[j]);
                        break;
                        case 2:
                        printf("%dc",ans[j]);
                        break;
                        case 3:
                        printf("%dm",ans[j]);
                        break;
                        default:
                        break;
                    }
                }
            }
        }
        printf("\n");
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:44:28: error: expected ':' before 'break'
   44 |                     default
      |                            ^
      |                            :
   45 |                     break;
      |                     ~~~~~
Language: C

#include<stdio.h>
int search(char a[]){
	int i,score,box=0;
	for(i=0;;i++){
		if(a[i]=='\0')break;
		switch(a[i]){
			case 'm' :if(a[i-1]>='2'&&a[i-1]<='9'&&i!=0)box+=(a[i-1]-'1')*1000;else box+=1000;break;
			case 'c' :if(a[i-1]>='2'&&a[i-1]<='9'&&i!=0)box+=(a[i-1]-'1')*100;else box+=100;break;
			case 'x' :if(a[i-1]>='2'&&a[i-1]<='9'&&i!=0)box+=(a[i-1]-'1')*10;else box+=10;;break;
			case 'i' :if(a[i-1]>='2'&&a[i-1]<='9'&&i!=0)box+=(a[i-1]-'1')*1;else box+=1;;break;
		}
	}
	return box;
}
int main(void){
	int n,i,j,flag,box;
	char mcxi1[10],mcxi2[10],ans[10];
	scanf("%d",&n);
	while(n--){
		for(i=0;i<10;i++){mcxi1[j]='\0';mcxi2[j]='\0';ans[i]='\0';}
		flag=0;
		scanf("%s%s",mcxi1,mcxi2);
		box=search(mcxi1);
		box+=search(mcxi2);
		for(i=0;i<10;i++){
			if(ans[i]='\0'){
				if(box/1000>1)ans[i]='1'+box/1000;ans[i+1]='m';
				else if(box/1000>0)ans[i]='m';
				else if(box/100>1)ans[i]='1'+box/1000;ans[i+1]='c';
				else if(box/100>0)ans[i]='c';
				else if(box/10>1)ans[i]='1'+box/1000;ans[i+1]='x';
				else if(box/10>0)ans[i]='x';
				else if(box/1>1){ans[i]='1'+box/1000;ans[i+1]='i';flag=1;}
				else if(box/1>0){ans[i]='i';flag=1;}
			}
			if(flag==1)break;
		}
		printf("%s\n",ans);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:33: error: expected '}' before 'else'
   28 |                                 else if(box/1000>0)ans[i]='m';
      |                                 ^~~~
main.c:30:33: error: 'else' without a previous 'if'
   30 |                                 else if(box/100>0)ans[i]='c';
      |                                 ^~~~
main.c:32:33: error: 'else' without a previous 'if'
   32 |                                 else if(box/10>0)ans[i]='x';
      |                                 ^~~~
main.c: At top level:
main.c:40:9: error: expected identifier or '(' before 'return'
   40 |         return 0;
      |         ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C++

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

int main(){
  int n;
  cin >> n;

  for(int i=0;i<n;i++){
    string str1, str2;
    string ans;
    cin >> str1 >> str2;

    int str_i=0, str_x=0, str_c=0, str_m=0;
    char c1[9],c2[9];
    strcpy(c1, str1.c_str());
    strcpy(c2, str2.c_str());

    for(int j=str1.size()-1;j>=0;j--){
      if(c1[j]=='m'||c1[j]=='c'||c1[j]=='x'||c1[j]=='i') {
        if(j>0){
          if(c1[j-1]>='2'&&c1[j-1]<='9'){
            if(c1[j]=='i') str_i+=(int)(c1[j-1]-'0');
            if(c1[j]=='c') str_c+=(int)(c1[j-1]-'0');
            if(c1[j]=='x') str_x+=(int)(c1[j-1]-'0');
            if(c1[j]=='m') str_m+=(int)(c1[j-1]-'0');
          }else{
            if(c1[j]=='i') str_i++;
            if(c1[j]=='c') str_c++;
            if(c1[j]=='x') str_x++;
            if(c1[j]=='m') str_m++;
          }
        }else{
          if(c1[j]=='i') str_i++;
          if(c1[j]=='c') str_c++;
          if(c1[j]=='x') str_x++;
          if(c1[j]=='m') str_m++;
        }
      }
    }

    for(int j=str2.size()-1;j>=0;j--){
      if(c2[j]=='m'||c2[j]=='c'||c2[j]=='x'||c2[j]=='i') {
        if(j>0){
          if(c2[j-1]>='2'&&c2[j-1]<='9'){
            if(c2[j]=='i') str_i+=(int)(c2[j-1]-'0');
            if(c2[j]=='c') str_c+=(int)(c2[j-1]-'0');
            if(c2[j]=='x') str_x+=(int)(c2[j-1]-'0');
            if(c2[j]=='m') str_m+=(int)(c2[j-1]-'0');
          }else{
            if(c2[j]=='i') str_i++;
            if(c2[j]=='c') str_c++;
            if(c2[j]=='x') str_x++;
            if(c2[j]=='m') str_m++;
          }

        }else{
          if(c2[j]=='i') str_i++;
          if(c2[j]=='c') str_c++;
          if(c2[j]=='x') str_x++;
          if(c2[j]=='m') str_m++;
        }
      }
    }

    if(str_i>=10){
      str_i-=10;
      str_x++;
    }
    if(str_x>=10){
      str_x-=10;
      str_c++;
    }
    if(str_c>=10){
      str_c-=10;
      str_m++;
    }

    if(str_m==1) ans = ans + 'm';
    else if(str_m!=0) ans=ans+to_string(str_m)+'m';
    if(str_c==1) ans = ans + 'c';
    else if(str_c!=0) ans=ans+to_string(str_c)+'c';
    if(str_x==1) ans = ans + 'x';
    else if(str_x!=0) ans=ans+to_string(str_x)+'x';
    if(str_i==1) ans = ans + 'i';
    else if(str_i!=0) ans=ans+to_string(str_i)+'i';

    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'strcpy' was not declared in this scope
   18 |     strcpy(c1, str1.c_str());
      |     ^~~~~~
a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

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

int main() {
bool a[1300000]={0};
a[1]=1;
for(int i=2;i<650001;i++){
	if(a[i]==1) continue;
	int j=2*i;
	while(j<1300000){
		a[j]=1;
		j=j+i;
	}
}
int k
while(cin>>k && k){
int ans;
if(a[k]==0) ans=0; 
else{
	int l=k+1,m=k-1;
	while(a[l]==0) l++;
	while(a[m]==0)  m--;
	ans=l-m;
}
cout<<ans<<endl;

}



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:1: error: expected initializer before 'while'
   18 | while(cin>>k && k){
      | ^~~~~
Language: C++

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

string itos(int n){
int a,b,c,d;
a=n/1000;
n=n%1000;
b=n/100;
n=n%100;
c=n/10;
c=n%10;
d=n;
string s=""; 
if(a>1) s=s+to_string(a);
if(a>0) s=s+"m";
if(b>1) s=s+to_string(b);
if(b>0) s=s+"c";
if(c>1) s=s+to_string(c);
if(c>0) s=s+"x";
if(d>1) s=s+to_string(d);
if(d>0) s=s+"i";
return s;
}


int stoi(string s){
int l=s.length();
int ans=0,k=1;
for(int i=0;i<l;i++){
if('1'<s[i] && s[i]<='9'){
k=s[i]-'0';
}
else if(s[i]='m'){
ans=ans+k*1000;
k=1;
}
else if(s[i]='c'){
ans=ans+k*100;
k=1;
}
else if(s[i]='x'){
ans=ans+k*10;
k=1;
}
else if(s[i]='i'){
ans=ans+k;
k=1;
}

}

return ans;
}










int main() {
string s,t;
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>s>>t;
int ans=stoi(s)+stoi(t);
cout<<itos(ans)<<endl;

}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: call of overloaded 'stoi(std::string&)' is ambiguous
   74 | int ans=stoi(s)+stoi(t);
      |         ~~~~^~~
a.cc:30:5: note: candidate: 'int stoi(std::string)'
   30 | int stoi(string s){
      |     ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:74:21: error: call of overloaded 'stoi(std::string&)' is ambiguous
   74 | int ans=stoi(s)+stoi(t);
      |                 ~~~~^~~
a.cc:30:5: note: candidate: 'int stoi(std::string)'
   30 | int stoi(string s){
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
Language: C++

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

string itos(int n){
int a,b,c,d;
a=n/1000;
n=n%1000;
b=n/100;
n=n%100;
c=n/10;
c=n%10;
d=n;
string s=""; 
if(a>1) s=s+to_string(a);
if(a>0) s=s+"m";
if(b>1) s=s+to_string(b);
if(b>0) s=s+"c";
if(c>1) s=s+to_string(c);
if(c>0) s=s+"x";
if(d>1) s=s+to_string(d);
if(d>0) s=s+"i";
return s;
}


int stoi(string s){
int l=s.length();
int ans=0,k=1;
for(int i=0;i<l;i++){
if('1'<s[i] && s[i]<='9'){
k=s[i]-'0';
}
else if(s[i]=='m'){
ans=ans+k*1000;
k=1;
}
else if(s[i]=='c'){
ans=ans+k*100;
k=1;
}
else if(s[i]=='x'){
ans=ans+k*10;
k=1;
}
else if(s[i]=='i'){
ans=ans+k;
k=1;
}

}

return ans;
}










int main() {
string s,t;
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>s>>t;
int ans=stoi(s)+stoi(t);
cout<<itos(ans)<<endl;

}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: call of overloaded 'stoi(std::string&)' is ambiguous
   74 | int ans=stoi(s)+stoi(t);
      |         ~~~~^~~
a.cc:30:5: note: candidate: 'int stoi(std::string)'
   30 | int stoi(string s){
      |     ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:74:21: error: call of overloaded 'stoi(std::string&)' is ambiguous
   74 | int ans=stoi(s)+stoi(t);
      |                 ~~~~^~~
a.cc:30:5: note: candidate: 'int stoi(std::string)'
   30 | int stoi(string s){
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
#define rep(i,n)	for(int i=0;i<n;i++)

char mcxi[4] = { 'i','x','c','m' };

int decode(string s);
string encode(int n);

int main() {
	int sum, n; cin >> n;
	while (n--) {
		string s1, s2; cin >> s1 >> s2;
		sum = decode(s1) + decode(s2);
		cout << encode(sum) << endl;
	}
	return 0;
}

int decode(string s) {
	int sum = 0;
	rep(i, s.size()) {
		int coe = 1;
		if (1 < s[i] - '0'&&s[i] - '0' <= 9) coe = s[i++] - '0';
		rep(j, 4) {
			if (s[i] == mcxi[j]) {
				sum += coe*(int)pow(10.0, j);
				break;
			}
		}
	}
	return sum;
}

string encode(int n) {
	string s;
	int tmp;
	for (int i = 3; i >= 0; i--) {
		tmp = (int)(n / pow(10.0, i));
		if (tmp > 1) {
			s.push_back(tmp + '0');
			s.push_back(mcxi[i]);
			n -= (int)(tmp*(pow(10.0, i)));
		}
		else if (tmp == 1) {
			s.push_back(mcxi[i]);
			n -= (int)(pow(10.0, i));
		}
	}
	return s;
}

Compiler output:
a.cc: In function 'int decode(std::string)':
a.cc:28:49: error: 'pow' was not declared in this scope
   28 |                                 sum += coe*(int)pow(10.0, j);
      |                                                 ^~~
a.cc: In function 'std::string encode(int)':
a.cc:40:33: error: 'pow' was not declared in this scope
   40 |                 tmp = (int)(n / pow(10.0, i));
      |                                 ^~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
#define rep(i,n)	for(int i=0;i<n;i++)

char mcxi[4] = { 'i','x','c','m' };

int decode(string s);
string encode(int n);

int main() {
	int sum, n; cin >> n;
	while (n--) {
		string s1, s2; cin >> s1 >> s2;
		sum = decode(s1) + decode(s2);
		cout << encode(sum) << endl;
	}
	return 0;
}

int decode(string s) {
	int sum = 0;
	rep(i, (int)s.size()) {
		int coe = 1;
		if (1 < s[i] - '0'&&s[i] - '0' <= 9) coe = s[i++] - '0';
		rep(j, 4) {
			if (s[i] == mcxi[j]) {
				sum += coe*(int)pow(10.0, j);
				break;
			}
		}
	}
	return sum;
}

string encode(int n) {
	string s;
	int tmp;
	for (int i = 3; i >= 0; i--) {
		tmp = (int)(n / pow(10.0, i));
		if (tmp > 1) {
			s.push_back(tmp + '0');
			s.push_back(mcxi[i]);
			n -= (int)(tmp*(pow(10.0, i)));
		}
		else if (tmp == 1) {
			s.push_back(mcxi[i]);
			n -= (int)(pow(10.0, i));
		}
	}
	return s;
}

Compiler output:
a.cc: In function 'int decode(std::string)':
a.cc:28:49: error: 'pow' was not declared in this scope
   28 |                                 sum += coe*(int)pow(10.0, j);
      |                                                 ^~~
a.cc: In function 'std::string encode(int)':
a.cc:40:33: error: 'pow' was not declared in this scope
   40 |                 tmp = (int)(n / pow(10.0, i));
      |                                 ^~~
Language: C++

#include<iostream>
#include<string>
#include<math.h>
using namespace std;
#define rep(i,n)	for(int i=0;i<n;i++)

char mcxi[4] = { 'i','x','c','m' };

int decode(string s);
string encode(int n);

int main() {
	int sum, n; cin >> n;
	while (n--) {
		string s1, s2; cin >> s1 >> s2;
		sum = decode(s1) + decode(s2);
		cout << encode(sum) << endl;
	}
	return 0;
}

int decode(string s) {
	int sum = 0;
	rep(i, (int)s.size()) {
		int coe = 1;
		if (1 < s[i] - '0'&&s[i] - '0' <= 9) coe = s[i++] - '0';
		rep(j, 4) {
			if (s[i] == mcxi[j]) {
				sum += coe*(int)pow(10.0, j);
				break;
			}
		}
	}
	return sum;
}

string encode(int n) {
	string s;
	int tmp;
	for (int i = 3; i >= 0; i--) {
		tmp = (int)(n / pow(10.0, i));
		if (tmp > 1) {
			s.push_back(tmp + '0');
			s.push_back(mcxi[i]);
			n -= (int)(tmp*(pow(10.0, i)));
		}
		else if (tmp == 1) {
			s.push_back(mcxi[i]);
			n -= (int)(pow(10.0, i));
		}
	}
	return s;
}
Status API Training Shop Blog About
?? 2016 GitHub, Inc. Terms 

Compiler output:
a.cc:54:1: error: 'Status' does not name a type
   54 | Status API Training Shop Blog About
      | ^~~~~~
Language: C++

#include <string>
#include <iostream>
using namespace std;
  
void itom(int num){
  int a=num/1000;
  if(a>1)cout<<a;
  if(a>0)cout<<'m';
  num%=1000;
 
  a=num/100;
  if(a>1)cout<<a;
  if(a>0)cout<<'c';
  num%=100;
 
  a=num/10;
  if(a>1)cout<<a;
  if(a>0)cout<<'x';
  num%=10;
 
  a=num;
  if(a>1)cout<<a;
  if(a>0)cout<<'i';
 
  cout<<endl;
}

void mtoi(string s){

    int res = 0;
    int mul = 1;
    for (int i=0; i<s.size(); i++) {
        if (s[i] >= '2' && s[i] <= '9') {
            mul = (int) s[i] - (int) '0';
        } else {
            switch (s[i]) {
                case 'm':
                    res += mul * 1000;
                    break;
                case 'c':
                    res += mul * 100;
                    break;
                case 'x':
                    res += mul * 10;
                    break;
                default:
                    res += mul;
            }
            mul = 1;
        }
    }
    return res; 
}

int main() {
    int n, i1, i2;
    cin >> n;
    while (n--) {
        string s1, s2;
        cin >> s1 >> s2;
        
        i1=mtoi(s1);
        i2=mtoi(s2);
        
        itom(i1+i2);
    }
    return 0;
}

Compiler output:
a.cc: In function 'void mtoi(std::string)':
a.cc:52:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   52 |     return res;
      |            ^~~
a.cc: In function 'int main()':
a.cc:62:16: error: void value not ignored as it ought to be
   62 |         i1=mtoi(s1);
      |            ~~~~^~~~
a.cc:63:16: error: void value not ignored as it ought to be
   63 |         i2=mtoi(s2);
      |            ~~~~^~~~