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

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

int play (int X) {
  if (X == a) {
    X = A[1];
    A.erase[1];
    if (A.size() == 0) {
      cout << A << endl;
      break;
    }
  }
  if (X == b) {
    X = B[1];
    B.erase[1];
    if (B.size() == 0) {
      cout << B << endl;
      break; 
    }
  }
    if (X == c) {
    X = C[1];
    C.erase[1];
    if (C.size() == 0) {
      cout << C << endl;
      break; 
    }
  }
  play(X);
  return X;
}

int main() {
  string A, B, C;
  cin >> A >> B >> C;
  A.erase[1];
  X = a;
  play(X);
  return 0;
}
  

Compiler output:
a.cc: In function 'int play(int)':
a.cc:5:12: error: 'a' was not declared in this scope
    5 |   if (X == a) {
      |            ^
a.cc:6:9: error: 'A' was not declared in this scope
    6 |     X = A[1];
      |         ^
a.cc:10:7: error: break statement not within loop or switch
   10 |       break;
      |       ^~~~~
a.cc:13:12: error: 'b' was not declared in this scope
   13 |   if (X == b) {
      |            ^
a.cc:14:9: error: 'B' was not declared in this scope
   14 |     X = B[1];
      |         ^
a.cc:18:7: error: break statement not within loop or switch
   18 |       break;
      |       ^~~~~
a.cc:21:14: error: 'c' was not declared in this scope
   21 |     if (X == c) {
      |              ^
a.cc:22:9: error: 'C' was not declared in this scope
   22 |     X = C[1];
      |         ^
a.cc:26:7: error: break statement not within loop or switch
   26 |       break;
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:36:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |   A.erase[1];
      |          ^
a.cc:37:3: error: 'X' was not declared in this scope
   37 |   X = a;
      |   ^
a.cc:37:7: error: 'a' was not declared in this scope
   37 |   X = a;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int X;
int play(X) {
  if (X == a) {
    X = A[1];
    A.erase[1];
    if (A.size() == 0) {
      cout << A << endl;
      break;
    }
  }
  if (X == b) {
    X = B[1];
    B.erase[1];
    if (B.size() == 0) {
      cout << B << endl;
      break; 
    }
  }
    if (X == c) {
    X = C[1];
    C.erase[1];
    if (C.size() == 0) {
      cout << C << endl;
      break; 
    }
  }
  play(X);
  
}

int main() {
  string A, B, C;
  cin >> A >> B >> C;
  A.erase[1];
  X = a;
  play(X);
  return 0;
}
  

Compiler output:
a.cc:4:13: error: expected ',' or ';' before '{' token
    4 | int play(X) {
      |             ^
a.cc: In function 'int main()':
a.cc:36:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |   A.erase[1];
      |          ^
a.cc:37:7: error: 'a' was not declared in this scope
   37 |   X = a;
      |       ^
a.cc:38:7: error: 'play' cannot be used as a function
   38 |   play(X);
      |   ~~~~^~~
Language: C++

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

int play(X) {
  if (X == a) {
    X = A[1];
    A.erase[1];
    if (A.size() == 0) {
      cout << A << endl;
      break;
    }
  }
  if (X == b) {
    X = B[1];
    B.erase[1];
    if (B.size() == 0) {
      cout << B << endl;
      break; 
    }
  }
    if (X == c) {
    X = C[1];
    C.erase[1];
    if (C.size() == 0) {
      cout << C << endl;
      break; 
    }
  }
  play(X);
  
}

int main() {
  string A, B, C;
  cin >> A >> B >> C;
  int X;
  A.erase[1];
  
  play(a);
  return 0;
}
  

Compiler output:
a.cc:4:10: error: 'X' was not declared in this scope
    4 | int play(X) {
      |          ^
a.cc: In function 'int main()':
a.cc:37:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |   A.erase[1];
      |          ^
a.cc:39:8: error: 'a' was not declared in this scope
   39 |   play(a);
      |        ^
a.cc:39:9: error: 'play' cannot be used as a function
   39 |   play(a);
      |         ^
Language: C++

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

int play(X) {
  if (X == a) {
    X = A[1];
    A.erase[1];
    if (A.size() == 0) {
      cout << A << endl;
      break;
    }
  }
  if (X == b) {
    X = B[1];
    B.erase[1];
    if (B.size() == 0) {
      cout << B << endl;
      break; 
    }
  }
    if (X == c) {
    X = C[1];
    C.erase[1];
    if (C.size() == 0) {
      cout << C << endl;
      break; 
    }
  }
  play(X);
  
}

int main() {
  string A, B, C;
  cin >> A >> B >> C;
  
  A.erase[1];
  
  play(a);
  return 0;
}
  

Compiler output:
a.cc:4:10: error: 'X' was not declared in this scope
    4 | int play(X) {
      |          ^
a.cc: In function 'int main()':
a.cc:37:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |   A.erase[1];
      |          ^
a.cc:39:8: error: 'a' was not declared in this scope
   39 |   play(a);
      |        ^
a.cc:39:9: error: 'play' cannot be used as a function
   39 |   play(a);
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string SA, SB, SC;
  cin >> SA >> SB >> SC;
  char next = SA.pop_front();
  while(true){
    switch(next){
      case 'a':
        if(SA.empty()){
          cout << 'A' << endl;
          return 0;
        }
        next = SA.pop_front();
        break;
      case 'b':
        if(SB.empty()){
          cout << 'B' << endl;
          return 0;
        }
        next = SB.pop_front();
        break;
      case 'c':
        if(SC.empty()){
          cout << 'C' << endl;
          return 0;
        }
        next = SC.pop_front();
        break;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
    7 |   char next = SA.pop_front();
      |                  ^~~~~~~~~
a.cc:15:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   15 |         next = SA.pop_front();
      |                   ^~~~~~~~~
a.cc:22:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   22 |         next = SB.pop_front();
      |                   ^~~~~~~~~
a.cc:29:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   29 |         next = SC.pop_front();
      |                   ^~~~~~~~~
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author dyominov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B3CardGameForThreeABCEdit solver = new B3CardGameForThreeABCEdit();
        solver.solve(1, in, out);
        out.close();
    }

    static class B3CardGameForThreeABCEdit {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String a = in.next();
            String b = in.next();
            String c = in.next();
            List<Character> listA = new LinkedList<>();
            List<Character> listB = new LinkedList<>();
            List<Character> listC = new LinkedList<>();
            for (char ch : a.toCharArray()) {
                listA.add(ch);
            }
            for (char ch : b.toCharArray()) {
                listB.add(ch);
            }
            for (char ch : c.toCharArray()) {
                listC.add(ch);
            }
            while (true) {
                char s = listA.remove(0);
                switch (s) {
                    case 'a': {
                        if (listC.isEmpty()) {
                            out.println("A");
                            return;
                        }
                        s = listA.remove(0);
                        break;
                    }
                    case 'b': {
                        if (listC.isEmpty()) {
                            out.println("B");
                            return;
                        }
                        s = listB.remove(0);
                        break;
                    }
                    case 'c': {
                        if (listC.isEmpty()) {


Compiler output:
Main.java:67: error: reached end of file while parsing
                        if (listC.isEmpty()) {
                                              ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
  string A, B, C;
  cin >> A >> B >> C;
  char next = 'a';
  char ans;
  for(;;) {
    if(next == 'a') {
      next = A.front();
      ans = 'A';
      if(A.length()) A.pop_front();
      else break;
    } else if (next == 'b') {
      next = B.front();
      ans = 'B';
      if(B.length()) B.pop_front();
      else break;
    } else if (next == 'c') {
      next = C.front();
      ans = 'C';
      if(C.length()) C.pop_front();
      else break;
    } else {
      break;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   14 |       if(A.length()) A.pop_front();
      |                        ^~~~~~~~~
a.cc:19:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   19 |       if(B.length()) B.pop_front();
      |                        ^~~~~~~~~
a.cc:24:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   24 |       if(C.length()) C.pop_front();
      |                        ^~~~~~~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define RREP(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

int main(){
    vector<string> st(3);
    REP(i,3){
        cin >> st[i];
    }
    vector<queue<int>> s(3);
    REP(i,3){
        REP(j,st[i].size()){
            s[i].push(st[i][j]-'a');
        }
    }
    int turn = 0;
    while(!s[turn].empty()){
        int temp = s[turn].pop();
        turn = temp;
    }
    cout << (char)('A'+turn) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:31: error: void value not ignored as it ought to be
   31 |         int temp = s[turn].pop();
      |                    ~~~~~~~~~~~^~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define RREP(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

int main(){
    vector<string> st(3);
    REP(i,3){
        cin >> st[i];
    }
    vector<queue<int>> s(3);
    REP(i,3){
        REP(j,st[i].size()){
            s[i].push(st[i][j]-'a');
        }
    }
    int turn = 0;
    while(!s[turn].empty()){
        int temp = s[turn].top();
        s[turn].pop();
        turn = temp;
    }
    cout << (char)('A'+turn) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:28: error: '__gnu_cxx::__alloc_traits<std::allocator<std::queue<int> >, std::queue<int> >::value_type' {aka 'class std::queue<int>'} has no member named 'top'; did you mean 'pop'?
   31 |         int temp = s[turn].top();
      |                            ^~~
      |                            pop
Language: C++

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


int main()
{
	char a[110]{}, b[110], c[110];
	scanf("%s%s%s", &a, &b, &c);
	int al, bl, cl;
	al = strlen(a);
	bl = strlen(b);
	cl = strlen(c);
	int ac, bc, cc;
	ac = bc = cc = 0;
	char temp = a[0];
	while (1)
	{
		if (temp == 'a')
		{
			++ac;
			if (ac == al)
			{
				cout << "A" << endl;
				return 0;
			}
			temp==a[ac]
		}
		else if (temp == 'b')
		{
			++bc;
			if (bc == bl)
			{
				cout << "B" << endl;
				return 0;
			}
			temp == b[bc];
		}
		else if (temp == 'c')
		{
			++cc;
			if (cc == cl)
			{
				cout << "C" << endl;
				return 0;
			}
			temp == c[cc];
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:36: error: expected ';' before '}' token
   28 |                         temp==a[ac]
      |                                    ^
      |                                    ;
   29 |                 }
      |                 ~
Language: C++

#include<iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<stdio.h>
#include<vector>
#define rep(i,n)for(int i=0;i<n;i++)
//printf("%.yf\n",x); xを小数点以下y桁で
using namespace std;
int main() {
	string a, b, c;
	cin >> a >> b >> c;
	int player = 0;
	for (;;) {
		if (player == 0) {
			if (a.size() == 1) {
				cout << "A" << endl;
				break;
			}
			if (a[0] == 'a') {
				player = 0;
			}
			if (a[0] == 'b') {
				player = 1;
			}
			if (a[0] == 'c') {
				player = 2;
			}
			a = a.substr(1, a.size-1);
		}if (player == 1) {
			if (b.size() == 1) {
				cout << "B" << endl;
				break;
			}
			if (b[0] == 'a') {
				player = 0;
			}
			if (b[0] == 'b') {
				player = 1;
			}
			if (b[0] == 'c') {
				player = 2;
			}
			b = b.substr(1, b.size - 1);
		}if (player == 2) {

			if (c.size() == 1) {
				cout << "C" << endl;
				break;
			}
			if (c[0] == 'a') {
				player = 0;
			}
			if (c[0] == 'b') {
				player = 1;
			}
			if (c[0] == 'c') {
				player = 2;
			}
			c = c.substr(1, c.size - 1);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   29 |                         a = a.substr(1, a.size-1);
      |                                         ~~^~~~
      |                                               ()
a.cc:44:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   44 |                         b = b.substr(1, b.size - 1);
      |                                         ~~^~~~
      |                                               ()
a.cc:60:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   60 |                         c = c.substr(1, c.size - 1);
      |                                         ~~^~~~
      |                                               ()
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  string s[2];
  REP(i,2){
    cin>>s[i];
  }
  int next=0;
  char next_char;
  while(s[next].size()){
    next_char=s[next][0];
    erase(s[next].begin(),s[next].begin()+1);
    if(next_char=='a'){
      next=0;
    }else if(next_char=='b'){
      next=1;
    }else{
      next=2;
    }
  }
  
  if(next==0){
    cout<<"A"<<endl;
  }else if(next==1){
    cout<<"B"<<endl;
  }else{
    cout<<"C"<<endl;
  }
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:95:5: error: 'erase' was not declared in this scope
   95 |     erase(s[next].begin(),s[next].begin()+1);
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  vector<string> s(2);
  REP(i,2){
    cin>>s[i];
  }
  int next=0;
  char next_char;
  while(s[next].size()){
    next_char=s[next][0];
    erase(s[next].begin(),s[next].begin()+1);
    if(next_char=='a'){
      next=0;
    }else if(next_char=='b'){
      next=1;
    }else{
      next=2;
    }
  }
  
  if(next==0){
    cout<<"A"<<endl;
  }else if(next==1){
    cout<<"B"<<endl;
  }else{
    cout<<"C"<<endl;
  }
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:95:5: error: 'erase' was not declared in this scope
   95 |     erase(s[next].begin(),s[next].begin()+1);
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  vector<string> s(2);
  REP(i,2){
    cin>>s[i];
  }
  int next=0;
  char next_char;
  while(s[next].size()){
    next_char=s[next][0]
    s[next]=s[next].substr(1,s[next].size()-1);
    if(next_char=='a'){
      next=0;
    }else if(next_char=='b'){
      next=1;
    }else{
      next=2;
    }
  }
  
  if(next==0){
    cout<<"A"<<endl;
  }else if(next==1){
    cout<<"B"<<endl;
  }else{
    cout<<"C"<<endl;
  }
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:94:25: error: expected ';' before 's'
   94 |     next_char=s[next][0]
      |                         ^
      |                         ;
   95 |     s[next]=s[next].substr(1,s[next].size()-1);
      |     ~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define elif else if
using namespace std;
string s[4];
int a=0,b=0,c=0,d=0;
signed main(){
	rep(i,3){
		cin>>s[i];
	}
	while(){
	    if(a==0){
		    a=s[0][b]-97;
		    b++;
	    }elif(a==1){
			a=s[1][c]-97;
			c++;
		}else{
			a=s[2][d]-97;
			d++;
		}
		if(b==s[0].size()||c==s[1].size()||d==s[2].size()){
			cout<<
	}    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected primary-expression before ')' token
   12 |         while(){
      |               ^
a.cc:25:9: error: expected primary-expression before '}' token
   25 |         }
      |         ^
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:8:14: note: to match this '{'
    8 | signed main(){
      |              ^
Language: C++

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

int main(){
  string sa,sb,sc;
  cin>>sa>>sb>>sc;

  int i=0;j=-1,k=-1;
  int na=sa.size(),nb=sb.size(),nc=sc.size();
  char ans = 'A';
  string cur = a;
  int cnt = i;

  while(i<na&&j<nb&&k<nc){
    if(cur[cnt]=='a'){
      i++;
      ans='A';
      cur=sa;
      cnt = i;
    }else if(cur[cnt]=='b'){
      j++;
      ans='B';
      cur=sb;
      cnt=j;
    }else{
      k++;
      ans='C';
      cur=sc;
      cnt=k;
    }
  }

  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'j' was not declared in this scope
    8 |   int i=0;j=-1,k=-1;
      |           ^
a.cc:8:16: error: 'k' was not declared in this scope
    8 |   int i=0;j=-1,k=-1;
      |                ^
a.cc:11:16: error: 'a' was not declared in this scope; did you mean 'na'?
   11 |   string cur = a;
      |                ^
      |                na
Language: C

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

// gcd(a,b)
int gcd(int a,int b){
	return (b == 0) ? a : gcd(b, a % b);
}

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

int main(int argc, char const *argv[]){
	int player = 0,turn[3] = {0,-1,-1};
	char card[3][120];
	scanf("%s %s %s",card[0],card[1],card[2]);
	for (int i = 0; i < strlen(card[0]) + strlen(card[1]) + strlen(card[2]); ++i){
		switch(card[player][turn[player]]){
			case 'a':
				player = 0;
				break;
			case 'b':
				player = 1;
				break;
			case 'c':
				player = 2;
				break;
		}
		if(++turn[player] > strlen(card[player])){
			printf("%c\n", (player + 'A'));
			return 0;
		}
	}
	printf("%c\n", (player + 'A'));
	return 0;
}


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

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

int main(){
  string A,B,C;
  cin >> A >> B >> C;
  int na=nb=nc=0;
  char X=A.at(0);
  while(true){
    if(X=='a'){
      na++;
      if(na==A.size()){
        cout << "A" << endl;
        return 0;
      }
      else X = A.at(na);
    }
     else if(X=='b'){
      nb++;
      if(nb==A.size()){
        cout << "B" << endl;
        return 0;
      }
      else X = B.at(nb);
    } 
     else if(X=='c'){
      nc++;
      if(nc==C.size()){
        cout << "C" << endl;
        return 0;
      }
      else X = C.at(nc);
    } 
  }
}
      
      
      
      
      
      
      
      
      
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'nb' was not declared in this scope; did you mean 'na'?
    7 |   int na=nb=nc=0;
      |          ^~
      |          na
a.cc:7:13: error: 'nc' was not declared in this scope; did you mean 'na'?
    7 |   int na=nb=nc=0;
      |             ^~
      |             na
Language: C++

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

string Aturn(int a,int b,int c,string A,string B, string C)
string Bturn(int a,int b,int c,string A,string B, string C)
string Cturn(int a,int b,int c,string A,string B, string C)
  
string Aturn(int a,int b,int c,string A,string B, string C){
  a++;
  if(a+1==A.size()) return "A";
  if(A.at(a) == 'a') Aturn(a,b,c,A,B,C);
  else if(A.at(a) == 'b') Bturn(a,b,c,A,B,C);
  else if(A.at(a) == 'c') Cturn(a,b,c,A,B,C);
}
string Bturn(int a,int b,int c,string A,string B, string C){
  b++;
  if(b+1==B.size()) return "B";
  if(B.at(b) == 'a') Aturn(a,b,c,A,B,C);
  else if(B.at(b) == 'b') Bturn(a,b,c,A,B,C);
  else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
}  
string Cturn(int a,int b,int c,string A,string B, string C){
  c++;
  if(c+1==C.size()) return "C";
  if(C.at(c) == 'a') Aturn(a,b,c,A,B,C);
  else if(C.at(c) == 'b') Bturn(a,b,c,A,B,C);
  else if(C.at(c) == 'c') Cturn(a,b,c,A,B,C);
}

int main(){
  string A,B,C;
  cin >> A >> B >> C;

  
  cout << Aturn(0,0,0,A,B,C) << endl;
}
  


Compiler output:
a.cc:5:1: error: expected initializer before 'string'
    5 | string Bturn(int a,int b,int c,string A,string B, string C)
      | ^~~~~~
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:18:22: error: 'Aturn' was not declared in this scope; did you mean 'Bturn'?
   18 |   if(B.at(b) == 'a') Aturn(a,b,c,A,B,C);
      |                      ^~~~~
      |                      Bturn
a.cc:20:27: error: 'Cturn' was not declared in this scope; did you mean 'Bturn'?
   20 |   else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
      |                           ^~~~~
      |                           Bturn
a.cc: In function 'std::string Cturn(int, int, int, std::string, std::string, std::string)':
a.cc:25:22: error: 'Aturn' was not declared in this scope; did you mean 'Cturn'?
   25 |   if(C.at(c) == 'a') Aturn(a,b,c,A,B,C);
      |                      ^~~~~
      |                      Cturn
a.cc: In function 'int main()':
a.cc:35:11: error: 'Aturn' was not declared in this scope; did you mean 'Cturn'?
   35 |   cout << Aturn(0,0,0,A,B,C) << endl;
      |           ^~~~~
      |           Cturn
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^
a.cc: In function 'std::string Cturn(int, int, int, std::string, std::string, std::string)':
a.cc:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
Language: C++

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



string Aturn(int a,int b,int c,string A,string B, string C){
  a++;
  if(a+1==A.size()) return "A";
  if(A.at(a) == 'a') Aturn(a,b,c,A,B,C);
  else if(A.at(a) == 'b') Bturn(a,b,c,A,B,C);
  else if(A.at(a) == 'c') Cturn(a,b,c,A,B,C);
}
string Bturn(int a,int b,int c,string A,string B, string C){
  b++;
  if(b+1==B.size()) return "B";
  if(B.at(b) == 'a') Aturn(a,b,c,A,B,C);
  else if(B.at(b) == 'b') Bturn(a,b,c,A,B,C);
  else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
}  
string Cturn(int a,int b,int c,string A,string B, string C){
  c++;
  if(c+1==C.size()) return "C";
  if(C.at(c) == 'a') Aturn(a,b,c,A,B,C);
  else if(C.at(c) == 'b') Bturn(a,b,c,A,B,C);
  else if(C.at(c) == 'c') Cturn(a,b,c,A,B,C);
}

int main(){
  string A,B,C;
  cin >> A >> B >> C;

  
  cout << Aturn(0,0,0,A,B,C) << endl;
}
  


Compiler output:
a.cc: In function 'std::string Aturn(int, int, int, std::string, std::string, std::string)':
a.cc:10:27: error: 'Bturn' was not declared in this scope; did you mean 'Aturn'?
   10 |   else if(A.at(a) == 'b') Bturn(a,b,c,A,B,C);
      |                           ^~~~~
      |                           Aturn
a.cc:11:27: error: 'Cturn' was not declared in this scope; did you mean 'Aturn'?
   11 |   else if(A.at(a) == 'c') Cturn(a,b,c,A,B,C);
      |                           ^~~~~
      |                           Aturn
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:18:27: error: 'Cturn' was not declared in this scope; did you mean 'Bturn'?
   18 |   else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
      |                           ^~~~~
      |                           Bturn
a.cc: In function 'std::string Aturn(int, int, int, std::string, std::string, std::string)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:19:1: warning: control reaches end of non-void function [-Wreturn-type]
   19 | }
      | ^
a.cc: In function 'std::string Cturn(int, int, int, std::string, std::string, std::string)':
a.cc:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
Language: C++

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



string Aturn(int a,int b,int c){
  a++;
  if(a+1==A.size()) return "A";
  if(A.at(a) == 'a') Aturn(a,b,c);
  else if(A.at(a) == 'b') Bturn(a,b,c);
  else if(A.at(a) == 'c') Cturn(a,b,c);
}
string Bturn(int a,int b,int c){
  b++;
  if(b+1==B.size()) return "B";
  if(B.at(b) == 'a') Aturn(a,b,c);
  else if(B.at(b) == 'b') Bturn(a,b,c);
  else if(B.at(b) == 'c') Cturn(a,b,c);
}  
string Cturn(int a,int b,int c){
  c++;
  if(c+1==C.size()) return "C";
  if(C.at(c) == 'a') Aturn(a,b,c);
  else if(C.at(c) == 'b') Bturn(a,b,c);
  else if(C.at(c) == 'c') Cturn(a,b,c);
}

int main(){
  int a=b=c=0;
  string A,B,C;
  cin >> A >> B >> C;
  
  cout << Aturn(a,b,c) << endl;
}
  

Compiler output:
a.cc: In function 'std::string Aturn(int, int, int)':
a.cc:8:11: error: 'A' was not declared in this scope
    8 |   if(a+1==A.size()) return "A";
      |           ^
a.cc:9:6: error: 'A' was not declared in this scope
    9 |   if(A.at(a) == 'a') Aturn(a,b,c);
      |      ^
a.cc:10:27: error: 'Bturn' was not declared in this scope; did you mean 'Aturn'?
   10 |   else if(A.at(a) == 'b') Bturn(a,b,c);
      |                           ^~~~~
      |                           Aturn
a.cc:11:27: error: 'Cturn' was not declared in this scope; did you mean 'Aturn'?
   11 |   else if(A.at(a) == 'c') Cturn(a,b,c);
      |                           ^~~~~
      |                           Aturn
a.cc: In function 'std::string Bturn(int, int, int)':
a.cc:15:11: error: 'B' was not declared in this scope
   15 |   if(b+1==B.size()) return "B";
      |           ^
a.cc:16:6: error: 'B' was not declared in this scope
   16 |   if(B.at(b) == 'a') Aturn(a,b,c);
      |      ^
a.cc:18:27: error: 'Cturn' was not declared in this scope; did you mean 'Bturn'?
   18 |   else if(B.at(b) == 'c') Cturn(a,b,c);
      |                           ^~~~~
      |                           Bturn
a.cc: In function 'std::string Cturn(int, int, int)':
a.cc:22:11: error: 'C' was not declared in this scope
   22 |   if(c+1==C.size()) return "C";
      |           ^
a.cc:23:6: error: 'C' was not declared in this scope
   23 |   if(C.at(c) == 'a') Aturn(a,b,c);
      |      ^
a.cc: In function 'int main()':
a.cc:29:9: error: 'b' was not declared in this scope
   29 |   int a=b=c=0;
      |         ^
a.cc:29:11: error: 'c' was not declared in this scope
   29 |   int a=b=c=0;
      |           ^
a.cc: In function 'std::string Aturn(int, int, int)':
a.cc:7:4: warning: control reaches end of non-void function [-Wreturn-type]
    7 |   a++;
      |   ~^~
a.cc: In function 'std::string Bturn(int, int, int)':
a.cc:14:4: warning: control reaches end of non-void function [-Wreturn-type]
   14 |   b++;
      |   ~^~
a.cc: In function 'std::string Cturn(int, int, int)':
a.cc:21:4: warning: control reaches end of non-void function [-Wreturn-type]
   21 |   c++;
      |   ~^~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
  	string a,b,c;
  	int counta=0,countb=0,countc=0;
  	int turn=1;
  	cin>>a>>b>>c;
  	counta++;
  	while(1){
      if(turn==1){
      if(a[counta-1]=='a'){
    	counta++;
    	turn=1;
    	}
      else if(a[count-1]=='b'){
      	countb++;
        turn=2;
      }else{
      	countc++;
        turn=3;
      }
    }else if(turn==2){
    	if(b[counta-1]=='a'){
    	counta++;
    	turn=1;
    	}
      else if(b[count-1]=='b'){
      	countb++;
        turn=2;
      }else{
      	countc++;
        turn=3;
      }
    }else{
    	if(c[counta-1]=='a'){
    	counta++;
    	turn=1;
    	}
      else if(c[count-1]=='b'){
      	countb++;
        turn=2;
      }else{
      	countc++;
        turn=3;
      }
    }if(counta==a.size()||countb==b.size()||countc==c.size())break;
    }
    if(counta==a.size())cout<<'A'<<endl;
  	else if(countb==b.size())cout<<'B'<<endl;
  	else cout<<'C'<<endl;
  	return 0;
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'count' was not declared in this scope; did you mean 'countc'?
   18 |       else if(a[count-1]=='b'){
      |                 ^~~~~
      |                 countc
a.cc:30:17: error: 'count' was not declared in this scope; did you mean 'countc'?
   30 |       else if(b[count-1]=='b'){
      |                 ^~~~~
      |                 countc
a.cc:42:17: error: 'count' was not declared in this scope; did you mean 'countc'?
   42 |       else if(c[count-1]=='b'){
      |                 ^~~~~
      |                 countc
Language: C++

#include<iostream>

using namespace std;
	string a,b,c;

void judge(string s){
  	if(s.size()==0)return;
	if(s[0]=='a'){
          s.erase(s.begin());
          judge(a);
        }
      	else if(s[0]=='b'){
          s.erase(s.begin());
          judge(b);
        }
      	else if(s[0]=='c') {
          s.erase(s.begin());
          judge(c);
        }
}

}

int main(){
  	cin>>a>>b>>c;
  	judge(a);
    if(a.size()==0)cout<<'A'<<endl;
  	else if(b.size()==0)cout<<'B'<<endl;
  	else cout<<'C'<<endl;
  	return 0;
}
  
  

Compiler output:
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include<iostream>

using namespace std;
	string a,b,c;

void judge(string s){
  	if(s.size()==0)return;
	if(s[0]=='a'){
          s.pop_front();
          judge(a);
        }
      	else if(s[0]=='b'){
          s.pop_front();
          judge(b);
        }
      	else if(s[0]=='c') {
          s.pop_front();
          judge(c);
        }
}

}

int main(){
  	cin>>a>>b>>c;
  	judge(a);
    if(a.size()==0)cout<<'A'<<endl;
  	else if(b.size()==0)cout<<'B'<<endl;
  	else cout<<'C'<<endl;
  	return 0;
}
  
  

Compiler output:
a.cc: In function 'void judge(std::string)':
a.cc:9:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
    9 |           s.pop_front();
      |             ^~~~~~~~~
a.cc:13:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   13 |           s.pop_front();
      |             ^~~~~~~~~
a.cc:17:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
   17 |           s.pop_front();
      |             ^~~~~~~~~
a.cc: At global scope:
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#define int long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;
 
signed main()
{
        string A,B,C; cin>>A>>B>>C;
        int posA=0,posB=0,posC=0;
        int cur=0;
        while(true){
                if(cur==0 and posA==A.size()){
                        cout<<'A'<<endl; 
                  	break;
                if(cur==1 and posB==B.size()){
                        cout<<'B'<<endl;
                  	break;
                }
                if(cur==2 and posC==C.size()){
                        cout<<'C'<<endl;
                  	break;
                }
                if(cur==0) cur=A[posA++]-'a';
                if(cur==1) cur=B[posB++]-'a';
                if(cur==2) cur=C[posC++]-'a';
        }
}

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

#include <iostream>
using namespace std;

int main(){
  string s[3];
  cin >> s[0] >> s[1] >> s[2];
  
  int x = 0, i[3] = {0};
  while(){
    if(i[x] == s[x].size()){
      char c = 'A' + x;
      cout << c << endl;
      return 0;
    }
    
    if(s[x][i[x]] == 'a'){
      i[x]++;
      x = 0;
    }else if(s[x][i[x]] == 'b'){
      i[x]++;
      x = 1;
    }else if(s[x][i[x]] == 'c'){
      i[x]++;
      x = 2;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected primary-expression before ')' token
    9 |   while(){
      |         ^
Language: C++

#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;

void game(void);
char winner;
string sa, sb, sc;

int main(void){

  cin >> sa >> sb >> sc;
  
  game();
  cout << winner << endl;
  return 0;
}

void game(){
  int turn = 0;
  int len_a = sa.strlen();
  int len_b = sa.strlen();
  int len_c = sa.strlen();
  int counter_a =0;
  int counter_b =0;
  int counter_c =0; 
  if(turn == 0 && counter_a == len_a){
    winner = 'A';
    return;
  } else if(turn == 0 && && counter_a != len_a){
    turn = sa[counter_a] - 'a';
    counter_a++;
  } else if(turn == 1 && counter_b == len_b){
    winner = 'B';
    return;
  } else if(turn == 1 && counter_b != len_b){
    turn = sb[counter_b] - 'a';
    counter_b++;
  } else if(turn == 2 && counter_c == len_c){
    winner = 'C';
    return;
  } else if(turn == 2 && counter_c != len_c){
    turn = sc[counter_c] - 'a';
    counter_c++;
  }
}

Compiler output:
a.cc: In function 'void game()':
a.cc:38:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strlen'
   38 |   int len_a = sa.strlen();
      |                  ^~~~~~
a.cc:39:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strlen'
   39 |   int len_b = sa.strlen();
      |                  ^~~~~~
a.cc:40:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strlen'
   40 |   int len_c = sa.strlen();
      |                  ^~~~~~
a.cc:47:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   47 |   } else if(turn == 0 && && counter_a != len_a){
      |                          ~~~~~~~~~~~~~^~~~~~~~
a.cc:47:29: error: label 'counter_a' used but not defined
   47 |   } else if(turn == 0 && && counter_a != len_a){
      |                             ^~~~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;

void game(void);
char winner;

int main(void){
  string sa, sb, sc;
  cin >> sa >> sb >> sc;
  
  game();
  cout << winner << endl;
  return 0;
}

void game(){
  int turn = 0;
  int len_a = sa.strlen();
  int len_b = sa.strlen();
  int len_c = sa.strlen();
  int counter_a =0;
  int counter_b =0;
  int counter_c =0; 
  if(turn == 0 && counter_a == len_a){
    winner = 'A';
    return;
  } else if(turn == 0 && && counter_a != len_a){
    turn = sa[counter_a] - 'a';
    counter_a++;
  } else if(turn == 1 && counter_b == len_b){
    winner = 'B';
    return;
  } else if(turn == 1 && counter_b == len_b){
    turn = sb[counter_b] - 'a';
    counter_b++;
  } else if(turn == 2 && counter_c == len_c){
    winner = 'C';
    return;
  } else if(turn == 2 && counter_c == len_c){
    turn = sc[counter_c] - 'a';
    counter_c++;
  }
}

Compiler output:
a.cc: In function 'void game()':
a.cc:37:15: error: 'sa' was not declared in this scope
   37 |   int len_a = sa.strlen();
      |               ^~
a.cc:46:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   46 |   } else if(turn == 0 && && counter_a != len_a){
      |                          ~~~~~~~~~~~~~^~~~~~~~
a.cc:53:12: error: 'sb' was not declared in this scope
   53 |     turn = sb[counter_b] - 'a';
      |            ^~
a.cc:59:12: error: 'sc' was not declared in this scope
   59 |     turn = sc[counter_c] - 'a';
      |            ^~
a.cc:46:29: error: label 'counter_a' used but not defined
   46 |   } else if(turn == 0 && && counter_a != len_a){
      |                             ^~~~~~~~~
Language: C++

import sys
SA = str(input())
SB = str(input())
SC = str(input())
turn = "A"
while (1):
    if( turn == "A"):
        if SA == "":
            break
        if SA[0] == "a":
            turn = "A"
        elif SA[0] == "b":
            turn = "B"
        else:
            turn = "C"
        SA = SA[1:]
    elif( turn == "B"):
        if SB == "":
            break
        if SB[0] == "a":
            turn = "A"
        elif SB[0] == "b":
            turn = "B"
        else:
            turn = "C"
        SB = SB[1:]
    else:
        if SC == "":
            break
        if SC[0] == "a":
            turn = "A"
        elif SC[0] == "b":
            turn = "B"
        else:
            turn = "C"
        SC = SC[1:]
print(turn)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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



int main()
{
	string Sa, Sb, Sc, n;
	int ai, bi, ci,Dis;
	ai = 0;
	bi = 0;
	ci = 0;
	n = "a";
	cin >> Sa >> Sb >> Sc;
	while (Dis==0){
		if (n == "a"){
			n = Sa.substr(ai, 1);
			ai++;
		}
		else if (n == "b"){
			n = Sb.substr(bi, 1);
			bi++;
		}
		else if(n=="c"){
			n = Sc.substr(ci, 1);
			ci++;
		}
		else{
			Dis++;
		}
	}
	if (n == "a"){
		n = "A";
	}
	else if (n == "b"){
		n = "B";
	}
	else(n == "c"){
		n = "C"
	}
	cout << n << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:23: error: expected ';' before '{' token
   40 |         else(n == "c"){
      |                       ^
      |                       ;
a.cc:40:16: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   40 |         else(n == "c"){
      |             ~~~^~~~~~~
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:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

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

int main(){
  string s[3];
  cint>>s[0]>>s[1]>>s[2];
  int turn=0;
  char c;
  while(true){
    if(s[turn]==""){
      cout<<(char)('A'+turn)<<endl;
    }
    c=s[turn].at(0);
    s[turn]=s[turn].substr(1,s[turn].length()-1);
    turn=c-'a';
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cint' was not declared in this scope; did you mean 'uint'?
    6 |   cint>>s[0]>>s[1]>>s[2];
      |   ^~~~
      |   uint