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

#include<bits/stdc++.h>
using namespace std;
int main(){
  queue<char>A;queue<char>B;queue<char>C;
  string a,b,c; cin>>a>>b>>c;
  for(int i=0;i<a.size();i++)A.push(a.at(i));
  for(int i=0;i<b.size();i++)B.push(b.at(i));
  for(int i=0;i<c.size();i++)C.push(c.at(i));
  int count=0;
  for(int i=0;i<500;i++){
    if(count==0){
      if(A.empty()){cout<<"A"<<endl;return 0;}
      count=A.top()-97;
      A.pop();
    }
    else if(count==1){
      if(B.empty()){cout<<"B"<<endl;return 0;}
      count=B.top()-97;
      B.pop();
    }
    else{
      if(C.empty()){cout<<"C"<<endl;return 0;}
      count=C.top()-97;
      C.pop();
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'class std::queue<char>' has no member named 'top'; did you mean 'pop'?
   13 |       count=A.top()-97;
      |               ^~~
      |               pop
a.cc:18:15: error: 'class std::queue<char>' has no member named 'top'; did you mean 'pop'?
   18 |       count=B.top()-97;
      |               ^~~
      |               pop
a.cc:23:15: error: 'class std::queue<char>' has no member named 'top'; did you mean 'pop'?
   23 |       count=C.top()-97;
      |               ^~~
      |               pop
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    stack<char>a,b,c;
    int a1=s1.length();
    int b2=s2.length();
    int c1=s3.length();
    for(int i=a1-1;i>=0;i--)
    {
        a.push(s1[i]);
    }
    for(int i=b1-1;i>=0;i--)
    {
        b.push(s2[i]);
    }
    for(int i=c1-1;i>=0;i--)
    {
        c.push(s3[i]);
    }
    char ch='a';
    bool p=false;
    char ans;
    while(!p)
    {
        if(ch=='a')
        {
            if(a.empty())
            {
                p=true;
                ans='A';
                break;
            }
            a.pop();
            ch=a.top();
        }
        else if(ch=='b')
        {
            if(b.empty())
            {
                p=true;
                ans='B';
                break;
            }
            b.pop();
            ch=b.top();
        }
        else
        {
            if(c.empty())
            {
                p=true;
                ans='C';
                break;
            }
            c.pop();
            ch=c.top();
        }
        if(p)
        {
            break;
        }
    }
    cout<<ans;
  	return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'b1' was not declared in this scope; did you mean 'c1'?
   18 |     for(int i=b1-1;i>=0;i--)
      |               ^~
      |               c1
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  
  char next = 'a';
  
  while (1) {
    if (next == 'a') {
      next = a.at(0);
      a.erase(a.begin());
      if (a.size() == 0) {
        cout << A << endl;
        break;
      }
    }
    if (next == 'b') {
      next = b.at(0);
      b.erase(b.begin());
      if (b.size() == 0) {
        cout << B << endl;
        break;
      }
    }
    if (next == 'c') {
      next = c.at(0);
      a.erase(c.begin());
      if (c.size() == 0) {
        cout << C << endl;
        break;
      }
    }
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'A' was not declared in this scope
   15 |         cout << A << endl;
      |                 ^
a.cc:23:17: error: 'B' was not declared in this scope
   23 |         cout << B << endl;
      |                 ^
a.cc:31:17: error: 'C' was not declared in this scope
   31 |         cout << C << endl;
      |                 ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>

using namespace std;

int main() {
  string p[3];
  char men[3] = {'A', 'B', 'C'};
  int idx[3] = {};
  for (int i=0; i<3; i++) cin >> p[i];
  int who = 0;
  while(1) {
    if ((int)p[who].length() == idx[who]) {cout << men[who] << endl; return 0;}
    idx[who]++;
    who = [who][idx[who]-1] - 'a';
    //while(p[i].length() > idx[i] && p[i][idx[i]-1] == men[i]+32) idx[i]++;
    //cout << men[i] << " " << idx[i] << endl;
    //if ((int)p[i].length() == idx[i]) {cout << men[i] << endl; return 0;}
  }
  return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:20:16: error: expected '{' before '[' token
   20 |     who = [who][idx[who]-1] - 'a';
      |                ^
a.cc: In function 'int main()':
a.cc:20:16: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string a, b, c;

    cin >> a >> b >> c;

    char t = 'a';
    while (true) {
        if (t == 'a') {
            if (!a.size()) {
                cout << "A";
                break;
            }

            t = a.front();
            a = a.substr(1, a.size() - 1);
        } else if (t == 'b') {
            if (!b.size()) {
                cout << "B";
                break;
            }

            t = b.front();
            b = b.substr(1, b.size() - 1);
        } else if (t == 'c') {
            if (!c.size()) {
                cout << "C";
                break;
            }

            t = c.front();
            c = c.substr(1, c.size() - 1);
        }
    }



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


#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

 int gcd(int a,int b){

   if(a%b == 0)
    return b;
   else
    return gcd(b,a%b);
 }

 long long numbers[500005];

 int main(){

  string a,b,c;
  cin>>a>>b>>c;

  char first = a[0];
  a.erase(0,1);

  while(1){

     if(n == 'a'){
        if(a.size() == 0){
            cout<<"A"<<endl;
            return 0; }
          n = a[0];
          a.erase(0,1);
     }else if(n == 'b'){
        if(b.size() == 0){
            cout<<"B"<<endl;
            return 0;
        }
        n = b[0];
        b.erase(0,1);
     }
     else if(n == 'c'){
         if(c.size() == 0){
            cout<<"C"<<endl;
            return 0;
         }
         n = c[0];
         c.erase(0,1);
       }
  }


 return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:39:9: error: 'n' was not declared in this scope
   39 |      if(n == 'a'){
      |         ^
Language: C

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

char s[3][110];
int now[3]={0,0,0};

int rec(int i){
    if(now[i] == strlen(s[i])) return i;
    char next = s[i][now[i]];
    now[i]++;
    return rec(next - 'a');
}

int main(){
    for(int i = 0; i < 3; i++) int ret = scanf("%s", s[i]);
    printf("%c\n", rec(0) + 'A');
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:32: error: expected expression before 'int'
   16 |     for(int i = 0; i < 3; i++) int ret = scanf("%s", s[i]);
      |                                ^~~
Language: Java

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

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    ArrayList<String> sa = new ArrayList<>();
    for(String s: scanner.next().split("")) {
      sa.add(s);
    }
    ArrayList<String> sb = new ArrayList<>();
    for(String s: scanner.next().split("")) {
      sb.add(s);
    }
    ArrayList<String> sc = new ArrayList<>();
    for(String s: scanner.next().split("")) {
      sc.add(s);
    }
    HashMap<String, ArrayList> smap = new HashMap<>();
    smap.put("a", sa);
    smap.put("b", sb);
    smap.put("c", sc);
    
    // 手番プレイヤーをAに決める
    // 繰り返し
    //  手番プレイヤーの配列0番目を見て、"a"なら次の人はAのように次の人を決める
    //  手番プレイヤーの配列0番目を捨てる
    //  手番プレイヤーの配列が長さ0なら手番プレイヤーの勝利で終わり
    String player = "a";
    while(true) {
      ArrayList<String> splayer = smap.get(player);
      if(splayer.size() == 0) {
        System.out.println(player.toUpperCase());
        break;
      }
      player = splayer.get(0);
      splayer.remove(0);
    }
  }
}


Compiler output:
Main.java:20: error: cannot find symbol
    HashMap<String, ArrayList> smap = new HashMap<>();
    ^
  symbol:   class HashMap
  location: class Main
Main.java:20: error: cannot find symbol
    HashMap<String, ArrayList> smap = new HashMap<>();
                                          ^
  symbol:   class HashMap
  location: class Main
2 errors
Language: C

a = list(input())
b = list(input())
c = list(input())
check = "a"
while len(a) != 0 and len(b) != 0 and len(c) != 0:
    if check == "a":
        check = a[0]
        a.pop(0)
    elif check == "b":
        check = b[0]
        b.pop(0)
    else:
        check = c[0]
        c.pop(0)

if len(a) == 1:
    print("A")
elif len(b) == 1:
    print("B")
else:
    print("C")

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a = list(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'list' [-Wimplicit-function-declaration]
    1 | a = list(input())
      |     ^~~~
main.c:1:10: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | a = list(input())
      |          ^~~~~
main.c:1:5: error: initializer element is not constant
    1 | a = list(input())
      |     ^~~~
main.c:2:1: error: expected ',' or ';' before 'b'
    2 | b = list(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string Sa,Sb,Sc;
  char card;
  int a = 1,b = 0,c = 0;
  int len_a,len_b,len_c;
  bool flag = true;
  
  cin >> Sa >> Sb >> Sc;
  len_a = Sa.size();
  len_b = Sb.size();
  len_c = Sc.size();
  
  card = Sa[0];
  
  while(flag){
    switch (card){
      case 'a':
        if(a == len_a - 1){
          cout << "A" << endl;
          flag =false;
          break;
        }
        else{
          a++;
          card = Sa[a];
        }
        break;
        
        case 'b';
        if(b == len_b - 1){
          cout << "B" << endl;
          flag = false;
          break;
        }
        else{
          b++;
          card = Sb[b];
        }
        break;
        case 'c':
        if(c == len_c - 1){
          cout << "C" << endl;
          flag = false;
          break;
        }
        else{
          c++;
          card = Sc[c];
        }
        break;
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: expected ':' before ';' token
   31 |         case 'b';
      |                 ^
      |                 :
Language: C++


#include<iostream>
using namespace std;
 

int main(){
    string sa, sb, sc;
    cin >> sa >> sb >> sc;
    int total = sa.length() + sb.length() + sc.length();
    int a = 0,b = 0,c = 0;
    char x = 'a';
    for (int i = 0; i < total - 2; i ++){
 
        if (x == 'a' && a <= sa.length() - 1){
            x = sa[a];
            a += 1;
        }
        if (x == 'b' && b <= sb.length() - 1){
            x = sb[b];
            b += 1;
        }
        if (x == 'c' && c <= sc.length() - 1){
            x = sc[c];
            c += 1;
        }
        if (a > sa.length() - 1){
            return 'A';
        }
        if (b > sb.length() - 1){
            return 'B'
        }
        if (c > sc.length() - 1){
            return 'C'
        }
    }
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: expected ';' before '}' token
   30 |             return 'B'
      |                       ^
      |                       ;
   31 |         }
      |         ~              
a.cc:33:23: error: expected ';' before '}' token
   33 |             return 'C'
      |                       ^
      |                       ;
   34 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;

int main(){
    string sa, sb, sc;
    cin >> sa >> sb >> sc;
    int total = sa.length() + sb.length() + sc.length();
    int a = 0,b = 0,c = 0;
    char x = 'a';
    for (int i = 1; i < total; i ++){
 
        if (x == 'a' && a <= sa.length() - 1){
            x = sa[a];
            a += 1;
        }
        if (x == 'b' && b <= sb.length() - 1){
            x = sb[b];
            b += 1;
        }
        if (x == 'c' && c <= sc.length() - 1){
            x = sc[c];
            c += 1;
        }
        if (a > sa.length() - 1){
            return 'A';
        }
        if (b > sb.length() - 1){
            return 'B'
        }
        if (c > sc.length() - 1){
            return 'C'
        }
    }
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: expected ';' before '}' token
   28 |             return 'B'
      |                       ^
      |                       ;
   29 |         }
      |         ~              
a.cc:31:23: error: expected ';' before '}' token
   31 |             return 'C'
      |                       ^
      |                       ;
   32 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;

int main(){
    string sa, sb, sc;
    cin >> s a>> sb >> sc;
    int total = sa.length() + sb.length() + sc.length();
    int a = 0,b = 0,c = 0;
    char x = 'a';
    for (int i = 1; i < total; i ++){
 
        if (x == 'a' && a <= sa.length() - 1){
            x = sa[a];
            a += 1;
        }
        if (x == 'b' && b <= sb.length() - 1){
            x = sb[b];
            b += 1;
        }
        if (x == 'c' && c <= sc.length() - 1){
            x = sc[c];
            c += 1;
        }
        if (a > sa.length() - 1){
            cout << 'A';
        }
        if (b > sb.length() - 1){
            cout << 'B';
        }
        if (c > sc.length() - 1){
            cout << 'C';
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 's' was not declared in this scope; did you mean 'sc'?
    6 |     cin >> s a>> sb >> sc;
      |            ^
      |            sc
Language: C++

#include <iostream>
using namespace std;

int main(){
    string sa,sb,sc;
    cin>>sa>>sb>>sc;
    int total=sa.length()+sb.length()+sc.length();
    int a=0,b=0,c=0;
    char x='a';
    for(int i=1;i<total;i++){

        if(x=='a'&&a<=sa.length()-1){
            x=sa[a];
            a+=1;
        }
        if(x=='b'&&b<=sb.length()-1){
            x=sb[b];
            b+=1;
        }
        if(x=='c'&&c<=sc.length()-1){
            x=sc[c];
            c+=1;
        }
        if(a>sa.length()-1){
            cout<<'a';
            return;
        }
        if(b>sb.length()-1){
            cout<<'b';
            return;
        }
        if(c>sc.length()-1){
            cout<<'c';
            return;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   26 |             return;
      |             ^~~~~~
a.cc:30:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   30 |             return;
      |             ^~~~~~
a.cc:34:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   34 |             return;
      |             ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    string sa,sb,sc;
    cin>>sa>>sb>>sc;
    int total=sa.length()+sb.length()+sc.length();
    int a=0,b=0,c=0;
    char x='a';
    for(int i=1;i<total;i++){

        if(x=="a"&&a<=sa.length()){
            x=sa[a];
            a+=1;
        }
        if(x=="b"&&b<=sb.length()){
            x=sb[b];
            b+=1;
        }
        if(x=="c"&&c<=sc.length()){
            x=sc[c];
            c+=1;
        }
        if(a>sa.length()){
            cout<<"a";
        }
        if(b>sb.length()){
            cout<<"b";
        }
        if(c>sc.length()){
            cout<<"c";
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if(x=="a"&&a<=sa.length()){
      |            ~^~~~~
a.cc:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         if(x=="b"&&b<=sb.length()){
      |            ~^~~~~
a.cc:20:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         if(x=="c"&&c<=sc.length()){
      |            ~^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    string sa,sb,sc;
    cin>>sa>>sb>>sc;
    int total=sa.length()+sb.length()+sc.length();
    int a=0,b=0,c=0;
    string x='a';
    for(int i=1;i<total;i++){

        if(x=="a"&&a<=sa.length()){
            x=sa[a];
            a+=1;
        }
        if(x=="b"&&b<=sb.length()){
            x=sb[b];
            b+=1;
        }
        if(x=="c"&&c<=sc.length()){
            x=sc[c];
            c+=1;
        }
        if(a>sa.length()){
            cout<<"a";
        }
        if(b>sb.length()){
            cout<<"b";
        }
        if(c>sc.length()){
            cout<<"c";
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |     string x='a';
      |              ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    string sa,sb,sc;
    cin>>sa>>sb>>sc;
    int total=sa.length()+sb.length()+sc.length()
    int a=0,b=0,c=0;
    string x='a';
    for(int i=1;i<total;i++){
        
        if(x="a"&&a<=sa.length()){
            x=sa[a];
            a+=1;
        }
        if(x="b"&&b<=sb.length()){
            x=sb[b];
            b+=1;
        }
        if(x="c"&&c<=sc.length()){
            x=sc[c];
            c+=1;
        }
        if(a>sa.length()){
            cout<<"a";
        }
        if(b>sb.length()){
            cout<<"b";
        }
        if(c>sc.length()){
            cout<<"c";
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'int'
    8 |     int a=0,b=0,c=0;
      |     ^~~
a.cc:9:14: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |     string x='a';
      |              ^~~
a.cc:12:19: error: 'a' was not declared in this scope
   12 |         if(x="a"&&a<=sa.length()){
      |                   ^
a.cc:16:19: error: 'b' was not declared in this scope
   16 |         if(x="b"&&b<=sb.length()){
      |                   ^
a.cc:20:19: error: 'c' was not declared in this scope
   20 |         if(x="c"&&c<=sc.length()){
      |                   ^
a.cc:24:12: error: 'a' was not declared in this scope
   24 |         if(a>sa.length()){
      |            ^
a.cc:27:12: error: 'b' was not declared in this scope
   27 |         if(b>sb.length()){
      |            ^
a.cc:30:12: error: 'c' was not declared in this scope
   30 |         if(c>sc.length()){
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    string sa,sb,sc;
    cin>>sa>>sb>>sc;
    int total=sa.length()+sb.length()+sc.length()
    int a=0,b=0,c=0;
    for(int i=1;i<total;i++){
        string x='a';
        if(x="a"&&a<=sa.length()){
            x=sa[a];
            a+=1;
        }
        if(x="b"&&b<=sb.length()){
            x=sb[b];
            b+=1;
        }
        if(x="c"&&c<=sc.length()){
            x=sc[c];
            c+=1;
        }
        if(a>sa.length()){
            cout<<"a";
        }
        if(b>sb.length()){
            cout<<"b";
        }
        if(c>sc.length()){
            cout<<"c";
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'int'
    8 |     int a=0,b=0,c=0;
      |     ^~~
a.cc:10:18: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |         string x='a';
      |                  ^~~
a.cc:11:19: error: 'a' was not declared in this scope
   11 |         if(x="a"&&a<=sa.length()){
      |                   ^
a.cc:15:19: error: 'b' was not declared in this scope
   15 |         if(x="b"&&b<=sb.length()){
      |                   ^
a.cc:19:19: error: 'c' was not declared in this scope
   19 |         if(x="c"&&c<=sc.length()){
      |                   ^
a.cc:23:12: error: 'a' was not declared in this scope
   23 |         if(a>sa.length()){
      |            ^
a.cc:26:12: error: 'b' was not declared in this scope
   26 |         if(b>sb.length()){
      |            ^
a.cc:29:12: error: 'c' was not declared in this scope
   29 |         if(c>sc.length()){
      |            ^
Language: C++

#include<iostream>
using namespace std;

int getNextTurn(int currentTurn, string decks){
    if(decks[currentTurn].length() == 0){
        return -1;
    }
    int nextTurn = decks[currentTurn][0] - 'a';
    decks[currentTurn] = decks[currentTurn].substr(1);
    return nextTurn;
}

int main(){
    string decks[3];
    for(int i=0; i<3; i++){
        cin >> decks[i];
    }

    int currentTurn = 0;
    while(true){
        int nextTurn = getNextTurn(currentTurn, decks);
        if(nextTurn < 0){
            cout << ((char)('A'+currentTurn)) << '\n';
            break;
        }
        currentTurn = nextTurn;
    }
}


Compiler output:
a.cc: In function 'int getNextTurn(int, std::string)':
a.cc:5:27: error: request for member 'length' in 'decks.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)currentTurn))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    5 |     if(decks[currentTurn].length() == 0){
      |                           ^~~~~~
a.cc:8:38: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
    8 |     int nextTurn = decks[currentTurn][0] - 'a';
      |                                      ^
a.cc:9:45: error: request for member 'substr' in 'decks.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)currentTurn))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    9 |     decks[currentTurn] = decks[currentTurn].substr(1);
      |                                             ^~~~~~
a.cc: In function 'int main()':
a.cc:21:49: error: could not convert '(std::string*)(& decks)' from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   21 |         int nextTurn = getNextTurn(currentTurn, decks);
      |                                                 ^~~~~
      |                                                 |
      |                                                 std::string* {aka std::__cxx11::basic_string<char>*}
Language: C

#include <bits/stdc++.h>

using namespace std;

#define vit vector<int>::iterator
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fr first
#define sc second
#define skip continue
#define PI 3.14159265

typedef unsigned long long ull;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

const int INF = 1e9 + 5;
const long long MAXN=2e5 + 5;;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool cmp(const string& a, const string& b) {
	return (a + b) < (b + a);
}

vector<int> Reversed(const vector<int>& s){
   vector<int> d = s;
   reverse(all(d));
   return d;
}

void solve(){
    string a, b, c;
    cin >> a >> b >> c;
    int sa = a.size(), sb = b.size(), sc = c.size(), i = 1, j = 0, k = 0;
    char ch = a[0];
    while(1){
        if(ch == 'a'){
            if(i == sa){
                cout << 'A';
                return;
            }
            ch = a[i];
            i++;
            continue;
        }
        if(ch == 'b'){
            if(j == sb){
                cout << 'B';
                return;
            }
            ch = b[j];
            j++;
            continue;
        }
        if(ch == 'c'){
            if(k == sc){
                cout << 'C';
                return;
            }
            ch = c[k];
            k++;
            continue;
        }
    }
}


int main(){
    //freopen("slalom.in","r",stdin);
    //freopen("slalom.out","w",stdout);
    //faster();
    int n = 1;
    //cin >> n;
    while(n--){
        solve();
        cout << endl;
    }
    //fclose(stdout);
}


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>
#include <Windows.h>

using namespace std;

#define vit vector<int>::iterator
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fr first
#define sc second
#define skip continue
#define PI 3.14159265

typedef unsigned long long ull;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

const int INF = 1e9 + 5;
const long long MAXN=2e5 + 5;;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool cmp(const string& a, const string& b) {
	return (a + b) < (b + a);
}

vector<int> Reversed(const vector<int>& s){
   vector<int> d = s;
   reverse(all(d));
   return d;
}

void solve(){
    string a, b, c;
    cin >> a >> b >> c;
    int sa = a.size(), sb = b.size(), sc = c.size(), i = 1, j = 0, k = 0;
    char ch = a[0];
    while(1){
        if(ch == 'a'){
            if(i == sa){
                cout << 'A';
                return;
            }
            ch = a[i];
            i++;
            continue;
        }
        if(ch == 'b'){
            if(j == sb){
                cout << 'B';
                return;
            }
            ch = b[j];
            j++;
            continue;
        }
        if(ch == 'c'){
            if(k == sc){
                cout << 'C';
                return;
            }
            ch = c[k];
            k++;
            continue;
        }
    }
}


int main(){
    //freopen("slalom.in","r",stdin);
    //freopen("slalom.out","w",stdout);
    //faster();
    int n = 1;
    //cin >> n;
    while(n--){
        solve();
        cout << endl;
    }
    //fclose(stdout);
}


Compiler output:
a.cc:2:10: fatal error: Windows.h: No such file or directory
    2 | #include <Windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
string sa,sb,sc;
cin>>sa>>sb>>sc;
ll a=1;
for(ll i=1; i>0; i++){
if(a=1){
if(sa.size()==0){
cout<<'A'<<endl;
break;}
if(sa.at(0)=='a'){
a=1;}
else if(sa.at(0)=='b'){
a=2;}
else
a=3;
sa=sa.substr(1,sa.size()-1);}
if(a=2){
if(sb.size()==0){
cout<<'B'<<endl;
break;}
if(sb.at(0)=='a'){
a=1;}
else if(sb.at(0)=='b'){
a=2;}
else
a=3;
sb=sb.substr(1,sb.size()-1);}
if(a=3){
if(sc.size()==0){
cout<<'C'<<endl;
break;}
if(sc.at(0)=='a'){
a=1;}
else if(sc.at(0)=='b'){
a=2;}
else
a=3;
sc=sc.substr(1,sc.size()-1);}}



Compiler output:
a.cc: In function 'int main()':
a.cc:56:31: error: expected '}' at end of input
   56 | sc=sc.substr(1,sc.size()-1);}}
      |                               ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

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

int main() {
  string[3] S;
  for (int i = 0; i < 3; ++i) cin >> S[i];
  
  vector<vector<int>> cards(3);
  for (int i = 0; i < 3; ++i) {
    for (auto &c : S[i]) {
      int n = -1;
      if (c == 'a') n = 0;
      if (c == 'b') n = 1;
      if (c == 'c') n = 2;
      cards[i].emplace_back(n);
    }
  }
  
  for (int i = 0; i < 3; ++i) reverse(cards[i].begin(), cards[i].end());
  int now = 0;
  while (1) {
    if (cards[now].empty()) break;
    int tmp = cards[now].back();
    cards[now].pop_back();
    now = tmp;
  }
  cout << now << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected identifier before numeric constant
    5 |   string[3] S;
      |          ^
a.cc:5:10: error: expected ']' before numeric constant
    5 |   string[3] S;
      |          ^
      |          ]
a.cc:5:9: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    5 |   string[3] S;
      |         ^
a.cc:5:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:9: error: empty structured binding declaration
a.cc:5:13: error: expected initializer before 'S'
    5 |   string[3] S;
      |             ^
a.cc:6:38: error: 'S' was not declared in this scope
    6 |   for (int i = 0; i < 3; ++i) cin >> S[i];
      |                                      ^
a.cc:10:20: error: 'S' was not declared in this scope
   10 |     for (auto &c : S[i]) {
      |                    ^
Language: C++

#include<iostream>
#include<vector>
int main(){
  std::vector<std::string> s(3);
  std::cin>>s[0]>>s[1]>>s[2];
  int t = 0;
  std::vector<int> i(3);
  while(1){
    if(s[t].size()==i[t]){
      std::cout<< 'A'+t std::endl;
      break;
    }
    t = s[t][i[t]++];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected ';' before 'std'
   10 |       std::cout<< 'A'+t std::endl;
      |                        ^~~~
      |                        ;
Language: C++

/*
 * atcoder/abc089/b.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
void solve();
int main() { solve(); return 0; }

void solve() {
  vector<string> S(3);
  vector<int> A(3);
  vector<vector<int> > B(3);
  vector<int> I(3, 0);
  loop(i,0,3) cin >> S[i];
  loop(i,0,3) A[i] = S[i].size();
  loop(i,0,3) {
    for (auto&&c: S[i]) {
      B[i].push_back(c-'a');
    }
    assert(B[i].size() == A[i]);
  }

  int cur = 0;
  while (I[0] < A[0] and I[1] < A[1] and I[2] < A[2]) {
    cur = B[I[cur]++];
  }
  
  string C = "ABC";
  loop(i,0,3) {
    if (I[i] == A[i]) {
      cout << C[i] << endl;
      return;
    }
  }
  cout << "D" << endl;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:38:21: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment
   38 |     cur = B[I[cur]++];
      |                     ^
Language: C++

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

int main() {
    string a, b, c;
    cin >> a >> b>> c;
    string x=a;
    char ans='A';
    while (1){
        if (x.empty()){
            cout << ans << endl;
            return 0;
        }
        x.erase(0,1);
        if (x.empty) continue;
        x=x.at(0);
        ans=char(x.at(0)-32);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: cannot convert 'std::__cxx11::basic_string<char>::empty' from type 'bool (std::__cxx11::basic_string<char>::)() const noexcept' to type 'bool'
   15 |         if (x.empty) continue;
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  vector<string> s(3);
  vector<int>used(3);
  rep(i,3) cin >> s[i];
  int now=0;
  while(true){
    if(s[now].size() > used[now].size()){
      used[now]++;
      now = s[now][used[now]-1]-'a';
    }
    else{
      cout << char('a'+now) << endl;
      return 0;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:34: error: request for member 'size' in 'used.std::vector<int>::operator[](((std::vector<int>::size_type)now))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   29 |     if(s[now].size() > used[now].size()){
      |                                  ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  vector<string> s(3),used(3);
  rep(i,3) cin >> s[i]
  int now=0;
  while(true){
    if(s[now].size() > used[now].size()){
      used[now]++;
      now = s[now][used[now]-1]-'a';
    }
    else{
      cout << char('a'+now) << endl;
      return 0;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: expected ';' before 'int'
   25 |   rep(i,3) cin >> s[i]
      |                       ^
      |                       ;
   26 |   int now=0;
      |   ~~~                  
a.cc:28:10: error: 'now' was not declared in this scope; did you mean 'pow'?
   28 |     if(s[now].size() > used[now].size()){
      |          ^~~
      |          pow
Language: Java

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

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    
    String popped = A.remove(0);
    
    while (true) {
      if (popped.equals("a")) {
        if (A.size() == 0) { System.out.println("A"); break; }
        popped = A.remove(0);
      } else if (popped.equals("b")) {
        if (B.size() == 0) { System.out.println("B"); break; }
        popped = B.remove(0);
      } else if (popped.equals("c")) {
        if (C.size() == 0) { System.out.println("C"); break; }
        popped = C.remove(0);
      } 
    }
  }
}


Compiler output:
Main.java:8: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
Main.java:9: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
Main.java:10: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    
    String popped = A.remove(0);
    
    while (true) {
      if (popped.equals("a")) {
        if (A.size() == 0) { System.out.println("A"); break; }
        popped = A.remove(0);
      } else if (popped.equals("b")) {
        if (B.size() == 0) { System.out.println("B"); break; }
        popped = B.remove(0);
      } else if (popped.equals("c")) {
        if (C.size() == 0) { System.out.println("C"); break; }
        popped = C.remove(0);
      } 
    }
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
Main.java:8: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:8: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:8: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
Main.java:9: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:9: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:9: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
9 errors
Language: Java


public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    
    String popped = A.remove(0);
    
    while (true) {
      if (popped.equals("a")) {
        if (A.size() == 0) { System.out.println("A"); break; }
        popped = A.remove(0);
      } else if (popped.equals("b")) {
        if (B.size() == 0) { System.out.println("B"); break; }
        popped = B.remove(0);
      } else if (popped.equals("c")) {
        if (C.size() == 0) { System.out.println("C"); break; }
        popped = C.remove(0);
      } 
    }
  }
}


Compiler output:
Main.java:4: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:6: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:6: error: cannot find symbol
    ArrayList<String> A = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<String> B = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
Main.java:8: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:8: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:8: error: cannot find symbol
    ArrayList<String> C = new ArrayList<>(Arrays.asList(sc.nextLine().split("")));
                                          ^
  symbol:   variable Arrays
  location: class Main
11 errors
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string a,b,c;
  cin>>a>>b>>c;
  char t='a';
  
  while(1){
    if(t=='a'&&a.empty()){
      cout<<"A"<<endl;
      return 0;
    }
    else if(t=='b'&&b.empty()){
      cout<<"B"<<endl;
      return 0;
    }
    else if(t=="C"&&c.empty()){
      cout<<"C"<<endl;
      return 0;
    }
    
    if(t=='a'){
      t=a[0];
      a.erase(a.begin());
    }
    else if(t=='b'){
      t=b[0];
      b.erase(b.begin());
    }
    else if(t=='c'){
        t=c[0];
      c.erase(c.begin());
    }
  }
  return  0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |     else if(t=="C"&&c.empty()){
      |             ~^~~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;

int main() {
    string a,b,c;
    cin >> a >> b >> c;
    char trun = 'a';
    while(true){
        if(trun=='a'){
            turn = a[0];
            a.erase(a.begin());
        }
        if(trun=='b'){
            turn = b[0];
            b.erase(b.begin());
        }
        if(trun=='c'){
            turn = c[0];
            c.erase(c.begin());
        }

        if(a.empty()) {
            cout << 'A' << endl;
            return 0;
        }
        if(b.empty()) {
            cout << 'B' << endl;
            return 0;
        }
        if(c.empty()) {
            cout << 'C' << endl;
            return 0;
        }
    } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'turn' was not declared in this scope; did you mean 'trun'?
   14 |             turn = a[0];
      |             ^~~~
      |             trun
a.cc:18:13: error: 'turn' was not declared in this scope; did you mean 'trun'?
   18 |             turn = b[0];
      |             ^~~~
      |             trun
a.cc:22:13: error: 'turn' was not declared in this scope; did you mean 'trun'?
   22 |             turn = c[0];
      |             ^~~~
      |             trun
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;

int main() {
    string a,b,c;
    cin >> a >> b >> c;
    char turn = 'a';
    while(true){
        if(trun=='a'){
            turn = a[0];
            a.erase(a.begin());
        }
        if(trun=='b'){
            turn = b[0];
            b.erase(b.begin());
        }
        if(trun=='c'){
            turn = c[0];
            c.erase(c.begin());
        }

        if(a.empty()) {
            cout << 'A' << endl;
            return 0;
        }
        if(b.empty()) {
            cout << 'B' << endl;
            return 0;
        }
        if(c.empty()) {
            cout << 'C' << endl;
            return 0;
        }
    } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'trun' was not declared in this scope; did you mean 'turn'?
   13 |         if(trun=='a'){
      |            ^~~~
      |            turn
a.cc:17:12: error: 'trun' was not declared in this scope; did you mean 'turn'?
   17 |         if(trun=='b'){
      |            ^~~~
      |            turn
a.cc:21:12: error: 'trun' was not declared in this scope; did you mean 'turn'?
   21 |         if(trun=='c'){
      |            ^~~~
      |            turn
Language: Java

import java.util.Scanner;

public class Practice {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String a = sc.next();
    String b = sc.next();
    String c = sc.next();
    StringBuilder aa = new StringBuilder(a);
    StringBuilder bb = new StringBuilder(b);
    StringBuilder cc = new StringBuilder(c);
    char x = aa.charAt(0);
    String ans = "";
    while (true) {
      if (x == 'a') {
        if (aa.length() == 0) {
          ans = "A";
          break;
        } else {
        x = aa.charAt(0);   
        aa.delete(0,1);
        }
      }
      if(x == 'b') {
        if (bb.length() == 0) {
          ans = "B";
          break;
        } else {
        x = bb.charAt(0); 
        bb.delete(0,1);
        }
      }
      if(x == 'c') {
        if (cc.length() == 0) {
          ans = "C";
          break;
        } else {
        x = cc.charAt(0); 
        cc.delete(0,1);
        }
      }
    }

    System.out.println(ans);
    
  }
}


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

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

int main(){
    string A, B, C;
  cin >> A >> B >> C;
  int ca = 1, cb = 1, cc = 1;
  char ans = 'a';
  while(ca < A.size() && cb < B.size() && cc < C.size()){
    if(ans == 'a'){
      ans = A[ca];
      ca++;
  }else if(ans == 'b'){
      ans = B[cb];
      cb++;
    }else{
      ans = C[cc];
      cc++;
    }
  }
    if(ca == A.size()){ans = 'a';}
    else if(cb == B.size()){ans = 'b';}
    else{ans = 'c'}
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: expected ';' before '}' token
   24 |     else{ans = 'c'}
      |                   ^
      |                   ;
Language: C++

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

int main(){
    string A, B, C;
  cin >> A >> B >> C;
  int ca = 1, cb = 1, cc = 1;
  char ans = a;
  while(ca < A.size() && cb < B.size() && cc < C.size()){
    if(ans == 'a'){
      ans = A[ca];
      ca++;
  }else if(ans == 'b'){
      ans = B[cb];
      cb++;
    }else{
      ans = C[cc];
      cc++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: 'a' was not declared in this scope
    9 |   char ans = a;
      |              ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^