criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;

public class B_45{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String saa = sc.next(), sbb = sc.next(), scc = sc.next();
		int na = saa.length(), nb = sbb.length(), nc = scc.length();
		int a = 0, b = 0, c = 0, turn = 0;
		while(true){
			if(turn == 0){
				if(a == na){
					System.out.println('A');
					break;
				}
				turn = saa.charAt(a) - 'a';
				a++;
			}else if(turn == 1){
				if(b == nb){
					System.out.println('B');
					break;
				}
				turn = sbb.charAt(b) - 'a';
				b++;
			}else{
				if(c == nc){
					System.out.println('C');
					break;
				}
				turn = scc.charAt(c) - 'a';
				c++;
			}
		}
	}
}

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

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

int main()
{
	char str_a[110], str_b[110], str_c[110],next;
	int i = 0, j = 0, k = 0;

	cin >> str_a >> str_b >> str_c;

	next = str_a[0];
	while(strlen(str_a)-i>0 && strlen(str_b)-j>0 && strlen(str_c)-k>0)
	{
		if (next == 'a') next = str_a[i++];
		if (next == 'b') next = str_b[j++];
		if(next == 'c')  next = str_c[k++];
	}
	cout << next << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: 'strlen' was not declared in this scope
   14 |         while(strlen(str_a)-i>0 && strlen(str_b)-j>0 && strlen(str_c)-k>0)
      |               ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | #include<string>
Language: C

#include <stdio.h>
int main(void){
int hito = 0, ai = 0, bi = 0, ci = 0;
	char a[100];
	char b[100];
	char c[100];
	gets(a);
	gets(b);
	gets(c);
	while(1){
		switch(hito){
			case 0:
			if(a[ai] == 'a'){
					hito = 0;
				}else if(a[ai] == 'b'){
					hito = 1;
				}else if(a[ai] == 'c'){
					hito = 2;
				}else{
					printf("A");
					return 0;
				}
			ai++;
			break;
			case 1:
			if(b[bi] == 'a'){
					hito = 0;
				}else if(b[bi] == 'b'){
					hito = 1;
				}else if(b[bi] == 'c'){
					hito = 2;
				}else{
					printf("B");
					return 0;
				}
			bi++;
			break;
			case 2:
				if(c[ci] == 'a'){
					hito = 0;
				}else if(c[ci] == 'b'){
					hito = 1;
				}else if(c[ci] == 'c'){
					hito = 2;
				}else{
					printf("C");
					return 0;
				}
			ci++;
			break;
			}
	
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |         gets(a);
      |         ^~~~
      |         fgets
main.c:53:1: error: expected declaration or statement at end of input
   53 | }
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main()
{
	char a[200],b[200],c[200];
	int oa=0,ob=0,oc=0,n=0;
	gets(a);
	gets(b);
	gets(c);
	for(;;)
	{
		switch(n)
		{
			case 0:
				if(oa==strlen(a))
				{
					puts("A");
					return 0;
				}
				n=a[oa++]-'a';
				break;
			case 1:
				if(ob==strlen(b))
				{
					puts("B");
					return 0;
				}
				n=b[ob++]-'a';
				break;
			case 2:
				if(oc==strlen(c))
				{
					puts("C");
					return 0;
				}
				n=c[oc++]-'a';
				break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   23 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

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

int main() {
    string sa, sb, sc;
    cin >> sa;
    cin >> sb;
    cin >> sc;
    int index_a = 0;
    int index_b, index_c = 0;
    char c = sa[0];
    char turn = 'a'
    while(true) {
        if(turn=='a') {
            if(index_a>=sa.size())
                break;
            turn = sa[index_a++];
        }else if(turn=='b'){
            if(index_b>=sb.size())
                break;
            turn = sb[index_b++];
        }else {
            if(index_c>=sc.size())
                break;
            turn = sc[index_c++];
        }
    }
    if(c=='a')
        cout << 'A' << endl;
    else if(c=='b')
        cout << 'B' << endl;
    else
        cout << 'C' << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected ',' or ';' before 'while'
   14 |     while(true) {
      |     ^~~~~
Language: C++

      #include<iostream>
        #include <string>
       #include <algorithm>
        using namespace std; 
         
        int main(){
        std :: string A,B,C;
        int lenA,lenB, lenC;
        int i, j, k;
        char turn;
        cin >> A >> B >>C;z
        lenB = B.size();
        lenC = C.size();
        i = j = k =0;
       turn ='a';
        while(1){
        if(i == lenA &&(turn =='a')){
        cout << 'A';
        break;
        }
        if(j == lenB&&(turn =='b')){
        cout << 'B';
        break;
        }
        if(k == lenC&&(turn =='c')){
        cout << 'C';
        break;
        }
        if (turn == 'a'){
        turn = A[i];
        i++;
        }      if (turn == 'b'){
        turn = B[j];
        j++;
        }  if (turn == 'c'){
        turn = C[k];
        k++;
        }
     }
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'z' was not declared in this scope
   11 |         cin >> A >> B >>C;z
      |                           ^
Language: C++

  #include<iostream>
        #include <string>
       #include <algorithm>
        using namespace std; 
         
        int main(){
        std :: string A,B,C;
        int lenA,lenB, lenC;
        int i, j, k;
        char turn;
        cin >> A >> B >>C;
        lenA = A.size();
        lenB = B.size();
        lenC = C.size();
        i = j = k =0;
       turn ='a';
        while(1){
        if(i == lenA &&(turn =='a')){
        cout << 'A';
        break;
        }
        if(j == lenB&&(turn =='b')){
        cout << 'B';
        break;
        }
        if(k == lenC&&(turn =='c')){
        cout << 'C';
        break;
        }
        if (turn == 'a'){
        turn = A[i];
        i++;
        }      if (turn == 'b'){
        turn = B[j];
        j++;
        }  if (turn == 'c'){
        turn = C[j];
        k++;
        }
     }

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

#include <stdio.h>
 
int main()
{
int i;
char moji[3][101];
int cnt[3];
 
for(i = 0; i < 3; i++){
scanf("%s, moji[i] );
cnt[i] = 0;
}
 
int pos = 0;
char c;
while (1){
c = moji[pos][cnt[pos]];
if (c == 'a'){
cnt[pos]++;
pos = 0;
}else if(c == 'b'){
cnt[pos]++;
pos = 1;
}else if(c == 'c'){
cnt[pos]++;
pos = 2;
}else if(c == '\0'){
if (pos == 0){
printf("A");
} else if (pos == 1){
printf("B");
} else if (pos == 2){
printf("C");
}
break;
}//if
}//while
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:7: warning: missing terminating " character
   10 | scanf("%s, moji[i] );
      |       ^
main.c:10:7: error: missing terminating " character
   10 | scanf("%s, moji[i] );
      |       ^~~~~~~~~~~~~~~
main.c:11:11: error: expected ')' before ';' token
   11 | cnt[i] = 0;
      |           ^
      |           )
main.c:10:6: note: to match this '('
   10 | scanf("%s, moji[i] );
      |      ^
main.c:11:8: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
   11 | cnt[i] = 0;
      | ~~~~~~~^~~
      |        |
      |        int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:11:12: error: expected ';' before '}' token
   11 | cnt[i] = 0;
      |            ^
      |            ;
   12 | }
      | ~
Language: C

#include <stdio.h>
 
int main()
{
int i;
char moji[3][101];
int cnt[3];
 
for(i = 0; i < 3; i++){
moji[i] = gets();
cnt[i] = 0;
}
 
int pos = 0;
char c;
while (1){
c = moji[pos][cnt[pos]];
if (c == 'a'){
cnt[pos]++;
pos = 0;
}else if(c == 'b'){
cnt[pos]++;
pos = 1;
}else if(c == 'c'){
cnt[pos]++;
pos = 2;
}else if(c == '\0'){
if (pos == 0){
printf("A");
} else if (pos == 1){
printf("B");
} else if (pos == 2){
printf("C");
}
break;
}//if
}//while
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 | moji[i] = gets();
      |           ^~~~
      |           fgets
main.c:10:9: error: assignment to expression with array type
   10 | moji[i] = gets();
      |         ^
Language: C

#include <stdio.h>
 
int main()
{
int i;
char moji[3][101];
int cnt[3];
 
for(i = 0; i < 3; i++){
moji[i] = *gets();
cnt[i] = 0;
}
 
int pos = 0;
char c;
while (1){
c = moji[pos][cnt[pos]];
if (c == 'a'){
cat[pos]++;
pos = 0;
}else if(c == 'b'){
cnt[pos]++;
pos = 1;
}else if(c == 'c'){
cat[pos]++;
pos = 2;
}else if(c == '\0'){
if (pos == 0){
printf("A");
} else if (pos == 1){
printf("B");
} else if (pos == 2){
printf("C");
}
break;
}//if
}//while
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:12: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 | moji[i] = *gets();
      |            ^~~~
      |            fgets
main.c:10:11: error: invalid type argument of unary '*' (have 'int')
   10 | moji[i] = *gets();
      |           ^~~~~~~
main.c:19:1: error: 'cat' undeclared (first use in this function); did you mean 'cnt'?
   19 | cat[pos]++;
      | ^~~
      | cnt
main.c:19:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main()
{
int i;
char moji[3][101];
int cnt[3];

for(i = 0; i < 3; i++){
scanf("%s", moji[i]);
cat[i] = 0;
}

int pos = 0;
char c;
while (1){
c = getchar(moji[pos][cnt[pos]]);
if (c == 'a'){
cat[pos]++;
pos = 0;
}else if(c == 'b'){
cat[pos]++;
pos = 1;
}else if(c == 'c'){
cat[pos]++;
pos = 2;
}else if(c == '\0'){
if (pos == 0){
printf("A");
} else if (pos == 1){
printf("B");
} else if (pos == 2){
printf("C");
}
break;
}//if
}//while
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:1: error: 'cat' undeclared (first use in this function); did you mean 'cnt'?
   11 | cat[i] = 0;
      | ^~~
      | cnt
main.c:11:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:5: error: too many arguments to function 'getchar'
   17 | c = getchar(moji[pos][cnt[pos]]);
      |     ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
  582 | extern int getchar (void);
      |            ^~~~~~~
Language: C

// abc045 - b
#include <stdio.h>
#include <stdint.h>

int main(void)
{
  char s[3][101];
  uint32_t i;
  uint32_t turn=0;
  uint32_t ptr[3];
  uint32_t len[3];
  for (i=0;i<3;i++) {
    scanf("%s", s[i]);
    ptr[i]=0;
    len[i]=strlen(s[i]);
  }
  while(1){
    p=ptr[turn];
    ptr[turn]++;
    turn=s[turn][p]-'a';
    if(len[turn]==ptr[turn]){
      printf("%c\n", 'A'+turn);
      return 0;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:12: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   15 |     len[i]=strlen(s[i]);
      |            ^~~~~~
main.c:4:1: note: include '<string.h>' or provide a declaration of 'strlen'
    3 | #include <stdint.h>
  +++ |+#include <string.h>
    4 | 
main.c:15:12: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   15 |     len[i]=strlen(s[i]);
      |            ^~~~~~
main.c:15:12: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:18:5: error: 'p' undeclared (first use in this function)
   18 |     p=ptr[turn];
      |     ^
main.c:18:5: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

    private static Scanner sc;

    public static void main(String[] args) {
        Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private void solve() {
        try {
          String[] aCards = sc.next().split("");
          String[] bCards = sc.next().split("");
          String[] cCards = sc.next().split("");

          String winner = "";
          String turn = "a";
          int firstA = 0;
          int firstB = 0;
          int firstC = 0;
          while(true) {
            if (turn.equals("a")) {
              if (aCards.length - 1 == firstA) {
                winner = "A";
                break;
              }
              turn = aCards[firstA];
              firstA++;
            } else if (turn.equals("b")) {
              if (bCards.length - 1 == firstB) {
                winner = "B";
                break;
              }
              turn = bCards[firstB];
              firstB++;
            } else {
              if (cCards.length - 1 == firstC) {
                winner = "C";
                break;
              }
              turn = cCards[firstC];
              firstC++;
            }

          System.out.println(winner);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null) br.close();
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String st = br.readLine();
            while (st == "") st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }
}


Compiler output:
Main.java:55: error: 'catch' without 'try'
        } catch (Exception e) {
          ^
Main.java:19: error: 'try' without 'catch', 'finally' or resource declarations
        try {
        ^
Main.java:60: error: illegal start of expression
    private class Scanner {
    ^
3 errors
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 10000
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end
using namespace std;
typedef pair<int, int> P;
int main(){

    vector<char>n1(100);
    vector<char>n2(100);
    vector<char>n3(100);
    vector<char>ex(1);
    ex.erase(ex.begin());
    if(ex.empty())
       // cout << "YES" << endl;
    rep(i,3){
        char temp[100];
        cin >> temp;
        int l =(int)strlen(temp);
        rep(j,l) {if(i == 0) {n1[j] = temp[j];}
        if(i == 1) {n2[j] = temp[j];}
        if(i == 2) {n3[j] = temp[j];}
        }
    }
    char del; int ans;
    del = n1[0];
    while(true)
    {
        //cout << del<<" ";
        if(del == 'a'){
            del = n1[0];
            n1.erase(n1.begin());
            if(!(n1[0]!= 'a' || n1[0] != 'b' || n1[0] != 'c'))
            {ans = 1;break;}

        }
        
        if(del == 'b'){
            del = n2[0];
            n2.erase(n2.begin());
            if(!(n2[0]!= 'a' || n2[0] != 'b' || n2[0] != 'c'))
            {ans = 2;break;}}
        if(del == 'c'){
            del = n3[0];
            n3.erase(n3.begin());
            if(!(n3[0]== 'a' || n3[0] == 'b' || n3[0] == 'c'))
            {ans = 3;break; }
        }}
    
    if(ans ==1)
        cout << "A" << endl;
    else if(ans == 2)
        cout << "B" << endl;
    else
        cout << "C" << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: 'strlen' was not declared in this scope
   32 |         int l =(int)strlen(temp);
      |                     ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include<set>
  +++ |+#include <cstring>
   11 | #define ll long long int
Language: C++

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

#define int long long

string readA,readB,readC;
char index;
char ans;
//int idxA,idxB,idxC;


signed main(){
    cin >> readA >> readB >> readC;

    index = readA[0];
    readA.erase(readA.begin());
    while(1){
        if(index == 'a'){
            if(readA.empty())break;
            index = readA[0];
            readA.erase(readA.begin());
            ans = 'A';
        }
        else if(index == 'b'){
            if(readB.empty())break;
            index = readB[0];
            readB.erase(readB.begin());
            ans = 'B';
        }
        else if(index == 'c'){
            if(readC.empty())break;
            index = readC[0];
            readC.erase(readC.begin());
            ans = 'C';
        }
    }

    cout << ans << endl;



    return 0;
}


Compiler output:
a.cc:7:6: error: 'char index' redeclared as different kind of entity
    7 | char index;
      |      ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:15:20: error: overloaded function with no contextual type information
   15 |     index = readA[0];
      |                    ^
a.cc:18:18: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator=='
   18 |         if(index == 'a'){
      |            ~~~~~~^~~~~~
a.cc:20:28: error: overloaded function with no contextual type information
   20 |             index = readA[0];
      |                            ^
a.cc:24:23: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator=='
   24 |         else if(index == 'b'){
      |                 ~~~~~~^~~~~~
a.cc:26:28: error: overloaded function with no contextual type information
   26 |             index = readB[0];
      |                            ^
a.cc:30:23: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator=='
   30 |         else if(index == 'c'){
      |                 ~~~~~~^~~~~~
a.cc:32:28: error: overloaded function with no contextual type information
   32 |             index = readC[0];
      |                            ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PlayGround {

	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		//System.out.println("starts...");
		//int n; 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		String c = br.readLine();
		char cA[] = a.toCharArray();
		char cB[] = b.toCharArray();
		char cC[] = c.toCharArray();
		int countA = 0;
		int countB = 0;
		int countC = 0;
		char turn = 'a';
		ser:while(true){
			if(turn == 'a'){
				if(countA == cA.length){
					System.out.print("A\n");
					break ser;
				}
				turn = cA[countA];
				countA++;
			}else
			if(turn == 'b'){
				if(countB == cB.length){
					System.out.print("B\n");
					break ser;
				}
				turn = cB[countB];
				countB++;
			}else
			if(turn == 'c'){
				if(countC == cC.length){
					System.out.print("C\n");
					break ser;
				}
				turn = cC[countC];
				countC++;
			}
		}
	}

}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string sa,sb,sc;cin>>sa>>sb>>sc;
  queue<char> qa,qb,qc;
  int i,j,k;
  for(i=0;i<sa.size();i++) qa.push(sa[i]);
  for(i=0;i<sb.size();i++) qb.push(sb[i]);
  for(i=0;i<sc.size();i++) qc.push(sc[i]);
  char ans='a';
  while(1){
    if(ans=='a'){if(qa.empty()) break;ans=qa.front();qa.pop();}
    if(ans=='b'){if(qb.empty()) break;ans=qb.front();qb.pop();}
    if(ans=='c'){if(qc.empty()) break;ans=qc.front();qc.pop();}
  }
  cout << (char)(ans+'A'-'a)' << endl;
  return 0;
}


Compiler output:
a.cc:16:26: warning: multi-character character constant [-Wmultichar]
   16 |   cout << (char)(ans+'A'-'a)' << endl;
      |                          ^~~~
a.cc: In function 'int main()':
a.cc:16:31: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   16 |   cout << (char)(ans+'A'-'a)' << endl;
      |                  ~~~~~~~~~~~~~^~~~~~~
a.cc:16:38: error: expected ')' before ';' token
   16 |   cout << (char)(ans+'A'-'a)' << endl;
      |                 ~                    ^
      |                                      )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string sa,sb,sc;cin>>sa>>sb>>sc;
  queue<char> qa,qb,qc;
  int i,j,k;
  for(i=0;i<sa.size();i++) qa.push(sa[i]);
  for(i=0;i<sb.size();i++) qb.push(sb[i]);
  for(i=0;i<sc.size();i++) qc.push(sc[i]);
  char ans='a';
  while(1){
    if(ans=='a'){if(qa.empty()) break;ans=qa.front();qa.pop()}
    if(ans=='b'){if(qb.empty()) break;ans=qb.front();qb.pop()}
    if(ans=='c'){if(qc.empty()) break;ans=qc.front();qc.pop()}
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:62: error: expected ';' before '}' token
   12 |     if(ans=='a'){if(qa.empty()) break;ans=qa.front();qa.pop()}
      |                                                              ^
      |                                                              ;
a.cc:13:62: error: expected ';' before '}' token
   13 |     if(ans=='b'){if(qb.empty()) break;ans=qb.front();qb.pop()}
      |                                                              ^
      |                                                              ;
a.cc:14:62: error: expected ';' before '}' token
   14 |     if(ans=='c'){if(qc.empty()) break;ans=qc.front();qc.pop()}
      |                                                              ^
      |                                                              ;
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc  = new Scanner(System.in);
    String a = sc.next();
    String b = sc.next();
    String c = sc.next();
    final int al = a.length();
    final int bl = b.length();
    final int cl = c.length();
    int aa = al;
    int bb = bl;
    int cc = cl;
    Char judge = a.charAt(al - aa);
    aa = aa - 1;
    while(true){
      if(judge = 'a'){
        if(aa == 0){break;}else{
        judge = a.charAt(al - aa);
        aa = aa -1;
        }
      }else if (judge = 'b') {
        if(bb == 0){break;}else{
        judge = b.charAt(bl - bb);
        bb = bb -1;
        }
      }else if(judge = 'c'){
        if(cc == 0){break;}else{
        judge = c.charAt(cl - cc);
        cc = cc -1;
        }
      }
    }
    if(judge == 'a'){Sytem.out.println("A");}else if(judge == 'b'){System.out.println("B");}else{System.out.println("C");}
  }
}


Compiler output:
Main.java:15: error: cannot find symbol
    Char judge = a.charAt(al - aa);
    ^
  symbol:   class Char
  location: class Main
Main.java:35: error: package Sytem does not exist
    if(judge == 'a'){Sytem.out.println("A");}else if(judge == 'b'){System.out.println("B");}else{System.out.println("C");}
                          ^
2 errors
Language: Java

import java.util.*;

public class ABC045B{
  public static void main(String[] args) {
    Scanner = new Scanner(System.in);
    String a = sc.next();
    String b = sc.next();
    String c = sc.next();
    final int al = a.length();
    final int bl = b.length();
    final int cl = c.length();
    int aa = al;
    int bb = bl;
    int cc = cl;
    Char judge = a.charAt(al - aa);
    aa = aa - 1;
    while(true){
      if(judge = 'a'){
        if(aa == 0){break;}else{
        judge = a.charAt(al - aa);
        aa = aa -1;
        }
      }else if (judge = 'b') {
        if(bb == 0){break;}else{
        judge = b.charAt(bl - bb);
        bb = bb -1;
        }
      }else if(judge = 'c'){
        if(cc == 0){break;}else{
        judge = c.charAt(cl - cc);
        cc = cc -1;
        }
      }
    }
    if(judge == 'a'){Sytem.out.println("A");}else if(judge == 'b'){System.out.println("B");}else{System.out.println("C");}
  }
}


Compiler output:
Main.java:3: error: class ABC045B is public, should be declared in a file named ABC045B.java
public class ABC045B{
       ^
Main.java:5: error: cannot find symbol
    Scanner = new Scanner(System.in);
    ^
  symbol:   variable Scanner
  location: class ABC045B
Main.java:6: error: cannot find symbol
    String a = sc.next();
               ^
  symbol:   variable sc
  location: class ABC045B
Main.java:7: error: cannot find symbol
    String b = sc.next();
               ^
  symbol:   variable sc
  location: class ABC045B
Main.java:8: error: cannot find symbol
    String c = sc.next();
               ^
  symbol:   variable sc
  location: class ABC045B
Main.java:15: error: cannot find symbol
    Char judge = a.charAt(al - aa);
    ^
  symbol:   class Char
  location: class ABC045B
Main.java:35: error: package Sytem does not exist
    if(judge == 'a'){Sytem.out.println("A");}else if(judge == 'b'){System.out.println("B");}else{System.out.println("C");}
                          ^
7 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

using ll = long long;
const ll mod = LLONG_MAX;

int main(){
  int ia=0,ib=0,ic=0;
  char a,b,c,x=a;
  string Sa,Sb,Sc;
  cin>>Sa>>Sb>>Sc;

while(1){

  if (x==a){
    x = Sa[ia];
    ia++;
  }

  if (ia<Sa.size()){
    cout<<'A'<<endl;
    return 0;
  }

  if (x==b){
    x = Sb[ib];
    ib++;
  }

  if (ib<Sb.size()){
    cout<<'B'<<endl;
    return 0;
  }

  if (x==c){
    x = Sc[ic];
    ic++;
  }

  if (ic<Sc.size()){
    cout<<'C'<<endl;
    return 0;
  }

}


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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

using ll = long long;
const ll mod = LLONG_MAX;

int main(){
  int ia=0,ib=0,ic=0;
  char a,b,c,x=a;
  string Sa,Sb,Sc;
  cin>>sa>>sb>>sc;

while{
  
  if (x==a){
    x = Sa[ia];
    ia++;
  }

  if (ia<Sa.size()){
    cout<<A<<endl;
    return 0;
  }

  if (x==b){
    x = Sb[ib];
    ib++;
  }

  if (ib<Sb.size()){
    cout<<B<<endl;
    return 0;
  }
  
  if (x==c){
    x = Sc[ic];
    ic++;
  }

  if (ic<S.size()){
    cout<<C<<endl;
    return 0;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'sa' was not declared in this scope; did you mean 'Sa'?
   14 |   cin>>sa>>sb>>sc;
      |        ^~
      |        Sa
a.cc:14:12: error: 'sb' was not declared in this scope; did you mean 'Sb'?
   14 |   cin>>sa>>sb>>sc;
      |            ^~
      |            Sb
a.cc:14:16: error: 'sc' was not declared in this scope; did you mean 'Sc'?
   14 |   cin>>sa>>sb>>sc;
      |                ^~
      |                Sc
a.cc:16:6: error: expected '(' before '{' token
   16 | while{
      |      ^
      |      (
a.cc:16:6: error: expected primary-expression before '{' token
a.cc:16:6: error: expected ')' before '{' token
   16 | while{
      |      ^
      |      )
a.cc:24:11: error: 'A' was not declared in this scope
   24 |     cout<<A<<endl;
      |           ^
a.cc:34:11: error: 'B' was not declared in this scope
   34 |     cout<<B<<endl;
      |           ^
a.cc:43:10: error: 'S' was not declared in this scope; did you mean 'Sc'?
   43 |   if (ic<S.size()){
      |          ^
      |          Sc
a.cc:44:11: error: 'C' was not declared in this scope
   44 |     cout<<C<<endl;
      |           ^
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:10:11: note: to match this '{'
   10 | int main(){
      |           ^
Language: Java

import java.util.Scanner;

/**
 * Created by wild on 16/09/26.
 */
public class B {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String one = scan.next();
        String two = scan.next();
        String three = scan.next();

        boolean ok = true;
        char turn = 'a';
        char winner = 'a';

        while (ok) {
            switch (turn) {
                case 'a':
                    if (one.equals(" ")){
                        winner = 'A';
                        ok = false;
                    }else {
                        turn = one.charAt(0);
                        one = ret(one);
                    }
                    break;
                case 'b':
                    if (two.equals(" ")){
                        winner = 'B';
                        ok = false;
                    }else {
                        turn = two.charAt(0);
                        two = ret(two);
                    }
                    break;
                case 'c':
                    if (three.equals(" ")){
                        winner = 'C';
                        ok = false;
                    }else {
                        turn = three.charAt(0);
                        three = ret(three);
                    }
                    break;
            }

        }
        System.out.println(winner);
    }

    public static String ret(String str) {
        if (str.length() != 1) {
            return str.substring(1);
        } else {
            return " ";
        }
    }
}

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


#include<iostream>
#include<string>
using namespace std;
char upper(char s);

int main(int argc, char const *argv[]) {
  string sa,sb,sc;
  int a=0,b=0,c=0;
  char turn='A';

  std::cin >> sa >> sb >> sc ;

  while (true) {
    if (turn=='A') {
      if(a==sa.size()-1){
        std::cout << turn << std::endl;
        return 0;
      }else{
        a++;
        turn=upper(sa[a]);
      }
    }else if (turn=='B') {
      if(b==sb.size()-1){
        std::cout << turn << std::endl;
        return 0;
      }else{
        b++;
        turn=upper(sb[b]);
      }
    }else(turn=='C') {
      if(c==sc.size()-1){
        std::cout << turn << std::endl;
        return 0;
      }else{
        c++;
        turn=upper(sc[c]);
      }
    }
  }
}

char upper(char s){
  if (s=='a') {
    return 'A';
  }else if(s=='b'){
    return 'B';
  }else{
    return 'C';
  }
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:31:21: error: expected ';' before '{' token
   31 |     }else(turn=='C') {
      |                     ^~
      |                     ;
Language: C++

#include<stdio.h>
#include<cstring>

int main()
{
	int a,b,c,ap=0,bp=0,cp=0,t=1;
	char A[110],B[110],C[110],tmp;
	
	gets(A);
	gets(B);
	gets(C);
	a=strlen(A);b=strlen(B);c=strlen(C);
	
	while(a+1!=ap && b+1 != bp && c+1 != cp)
	{
		if(t == 0)
		{
			t = A[ap]-'a';
			ap++;
		}
		else if( t == 1){
			t = B[bp]-'a';
			bp++;
		}
		else{
			t = C[cp]-'a';
			cp++;
		}
	}
	
	if(a+1 == ap)puts("A"); else if( b+1 == bp)puts("B");
	else puts("C");
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets(A);
      |         ^~~~
      |         getw
Language: C++

#include<stdio.h>
int main(){
	char a[110], b[110], c[110], t='a';
	int ap=0, bp=0, cp=0;
	scanf("%s",a);
	scanf("%s",b);
	scanf("%s",c);
	while(1){
		if(t=='a'){
			if(a[ap]!='\0'){
				t=a[ap];
				ap++;
			}else{
				printf("A");
				return 0;
				}
			}
		}if(t=='b'){
			if(a[bp]!='\0'){
				t=b[bp];
				bp++;
			}else{
				printf("B");
				return 0;
	}
}if(t=='c'){
			if(c[cp]!='\0'){
				t=c[cp];
				cp++;
			}else{
				printf("C");
				return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:32:42: error: expected '}' at end of input
   32 |                                 return 0;
      |                                          ^
a.cc:30:30: note: to match this '{'
   30 |                         }else{
      |                              ^
a.cc:32:42: error: expected '}' at end of input
   32 |                                 return 0;
      |                                          ^
a.cc:26:12: note: to match this '{'
   26 | }if(t=='c'){
      |            ^
a.cc:32:42: error: expected '}' at end of input
   32 |                                 return 0;
      |                                          ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
	char a[110], b[110], c[110]; t='a';
	int ap=0; bp=0, cp=0;
	scanf("%s",a);
	scanf("%s",c);
	scanf("%s",b);
	while(1){
		if(t=='a'){
			if(a[ap]!='\0'){
				t=a[ap];
				ap++;
		}else{
			printf("A");
			return0;
		if(t=='b'){
			if(a[ap]!='\0'){
				t=a[bp];
				bp++;
		}else{
			printf("B");
			return0;
			if(t==a){
		if(a[ap]!='\0'){
				t=a[cp];
				cp++;
		}else{
			printf("C");
			return0;
		}
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:38: error: 't' was not declared in this scope
    3 |         char a[110], b[110], c[110]; t='a';
      |                                      ^
a.cc:4:19: error: 'bp' was not declared in this scope; did you mean 'ap'?
    4 |         int ap=0; bp=0, cp=0;
      |                   ^~
      |                   ap
a.cc:4:25: error: 'cp' was not declared in this scope; did you mean 'ap'?
    4 |         int ap=0; bp=0, cp=0;
      |                         ^~
      |                         ap
a.cc:15:25: error: 'return0' was not declared in this scope
   15 |                         return0;
      |                         ^~~~~~~
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:9:27: note: to match this '{'
    9 |                 if(t=='a'){
      |                           ^
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:8:17: note: to match this '{'
    8 |         while(1){
      |                 ^
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: Java

/**
 * Created by Raph on 21/09/2016.
 */
import java.util.*;

public class ThreeCard {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String cardsInput = sc.next();
        char alice[] = cardsInput.toCharArray();
        cardsInput = sc.next();
        char bob[] = cardsInput.toCharArray();
        cardsInput = sc.next();
        char charlie[] = cardsInput.toCharArray();
        int currA = 0;
        int currB = 0;
        int currC = 0;
        char curr = 'a';
        while (currA != alice.length 	&&
                currB != bob.length 	&&
                currC != charlie.length){
            if (curr == 'a') {
                curr = alice[currA];
                currA ++;
            } else if (curr == 'b') {
                curr = bob[currB];
                currB ++;
            } else {
                curr = charlie[currC];
                currC ++;
            }
        }
        System.out.println(Character.toUpperCase(curr));
    }
}


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

#include <stdio.h>

int main(){
char a[101],b[101],c[101],d;
int aa=1,bb=0,cc=0;

scanf("%s",&a);
scanf("%s",&b);
scanf("%s",&c);

d=a[0]
while(){
if(d=='\0'){
	printf("%C",d);
	break;
}
if(d=='a'){
aa++;
d=a[aa];
}else if(d=='b'){
bb++;
d=b[bb];
}else{
cc++;
d=c[cc];
}
}

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:7: error: expected ';' before 'while'
   11 | d=a[0]
      |       ^
      |       ;
   12 | while(){
      | ~~~~~
Language: C++

#include <bits/stdc++.h>

int main(void)
{
  auto a = string{};
  auto b = string{};
  auto c = string{};
  char current = 'a';
  std::cin >> a >> b >> c;
  while (a.length && b.length && c.length) {
    switch (current) {
    case 'a':
      current = a[0];
      a = a.substr(1);
      break;
    case 'b':
      current = b[0];
      b = b.substr(1);
      break;
    case 'c':
      current = c[0];
      c = c.substr(1);
      break;
    }
  }
  std::cout << toupper(current) << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'string' was not declared in this scope
    5 |   auto a = string{};
      |            ^~~~~~
a.cc:5:12: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:18: error: expected ',' or ';' before '{' token
    6 |   auto b = string{};
      |                  ^
a.cc:7:18: error: expected ',' or ';' before '{' token
    7 |   auto c = string{};
      |                  ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(void)
{
string cards[3];
int turn = 0;
cin>>cards[0]>>cards[1]>>cards[2];
while(true)
{
if(cards[turn].empty())break;
cards[turn].erase(cards[turn].begin(),1);
turn = cards[turn][0]-65;
}
cout<<(char)(turn+65)<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, int)'
   12 | cards[turn].erase(cards[turn].begin(),1);
      | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
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:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 2114 |       erase(size_type __pos = 0, size_type __n = npos)
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:2114:23: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 2114 |       erase(size_type __pos = 0, size_type __n = npos)
      |             ~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
 2134 |       erase(__const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:2134:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
 2154 |       erase(__const_iterator __first, __const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:2154:56: note:   no known conversion for argument 2 from 'int' to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'}
 2154 |       erase(__const_iterator __first, __const_iterator __last)
      |                                       ~~~~~~~~~~~~~~~~~^~~~~~
Language: C++


#include <iostream>
#include <iomanip>
#include <ios>
#include <sstream>
#include <cstdio>

#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <regex>
#include <utility>

#include <cstddef>
#include <cstdint>
#include <cfloat>
#include <limits>

#include <array>
#include <bitset>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <valarray>
#include <vector>
#include <deque>
#include <forward_list>

#define FOR(i, a, b) for(itr i{a}; i < (b); ++i)
#define RFOR(i, a, b) for(itr i{(b)-1};i >= (a); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(a) std::begin(a), std::end(a)
#define TYPE(t) decltype(t)
#define _IT ::iterator
#define UN unsigned
#define SC(t, a) static_cast<t>(a)

template<typename T>
inline bool in_range(T const &lower, T const &a, T const &upper){ return lower < a && a < upper;}

constexpr double inf = std::numeric_limits<double>::infinity();

using i8 = std::int_fast8_t;  using i16 = std::int_fast16_t;
using i32 = std::int_fast32_t;  using i64 = std::int_fast64_t;
using u8 = std::uint_fast8_t; using u16 = std::uint_fast16_t;
using u32 = std::uint_fast32_t; using u64 = std::uint_fast64_t;

using namespace std;

using itr = i32;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  string A, B, C;

  cin >> A >> B >> C;
  
  string _IT its[3] = {A.begin(), B.begin(), C.begin()};

  char p;

  for(char i = *its[0]; i != '\0'; i = *++its[i-'a']) p = i;

  
  cout << SC(char, toupper(p)) << endl;


  return 0;

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

#include <bits/stdc++.h>
using namespace std;
int main() {
string ss[3];
cin >> ss[0] >> ss[1] >> ss[2];
char cur;
cur = 'a';
while (ss[cur - 'a'].length()) {
char tmp = ss[cur][0];
ss[cur] = ss[cur].substring(1, npos);
cur = tmp;
}
cout << toUpper(cur) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'substring'; did you mean 'substr'?
   10 | ss[cur] = ss[cur].substring(1, npos);
      |                   ^~~~~~~~~
      |                   substr
a.cc:10:32: error: 'npos' was not declared in this scope
   10 | ss[cur] = ss[cur].substring(1, npos);
      |                                ^~~~
a.cc:13:9: error: 'toUpper' was not declared in this scope; did you mean 'toupper'?
   13 | cout << toUpper(cur) << endl;
      |         ^~~~~~~
      |         toupper
Language: C++

#include <iostream>
#include <string>
#include <queue>

using namespace std;

int main(){
    string ainp,binp,cinp;
    cin >> ainp >> binp >> cinp;
    queue<char> a,b,c;
    for(int i=0;i<ainp.size();i++) a.push(ainp[i]);
    for(int i=0;i<binp.size();i++) b.push(binp[i]);
    for(int i=0;i<cinp.size();i++) c.push(cinp[i]);

    if(a.size() != 0){
        char before = a.front();a.pop();
    }else{
        cout << "A";
    }

    while(true){
        if(a.size() == 0) {cout << "A";return 0;}
        if(b.size() == 0) {cout << "B";return 0;}
        if(c.size() == 0) {cout << "C";return 0;}
        if(before == 'a') before = a.front();a.pop();
        if(before == 'b') before = b.front();b.pop();
        if(before == 'c') before = c.front();c.pop();
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: 'before' was not declared in this scope
   25 |         if(before == 'a') before = a.front();a.pop();
      |            ^~~~~~
a.cc:26:12: error: 'before' was not declared in this scope
   26 |         if(before == 'b') before = b.front();b.pop();
      |            ^~~~~~
a.cc:27:12: error: 'before' was not declared in this scope
   27 |         if(before == 'c') before = c.front();c.pop();
      |            ^~~~~~
Language: Java


import java.util.Scanner;

public class Practice {

	public static void main(String[] args) {



		Scanner scan = new Scanner(System.in);

		System.out.println("aさん>");
		String a = scan.nextLine();

		System.out.println("bさん>");
		String  b = scan.nextLine();

		System.out.println("cさん>");
		String  c = scan.nextLine();

		char result =c.charAt(c.length()-1);

		System.out.println("結果"+result);



		}

}



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

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
 
int main(){
  string temp;
  string x,y,z;
  cin >> x >> y >> z;
  temp=x[0];
  x=x.substr(1,x.size()-1)
  while(1){
    if(temp=="a"){
      if(x.size()==0){
        cout << "A" << endl;
        return 0;
      }
      temp=x[0];
      x=x.substr(1,x.size()-1);
    }
    else if(temp=="b"){
      if(y.size()==0){
        cout << "B" << endl;
        return 0;
      }
      temp=y[0];
      y=y.substr(1,y.size()-1);
    }
    else{
      if(z.size()==0){
        cout << "C" << endl;
        return 0;
      }
      temp=z[0];
      z=z.substr(1,z.size()-1);
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: expected ';' before 'while'
   13 |   x=x.substr(1,x.size()-1)
      |                           ^
      |                           ;
   14 |   while(1){
      |   ~~~~~