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

main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:20: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                    ^~~~
main.c:1:37: error: invalid type argument of unary '*' (have 'int')
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                     ^~
main.c:1:43: error: subscripted value is neither array nor pointer nor vector
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                           ^
main.c:1:49: error: invalid type argument of unary '*' (have 'int')
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                                 ^~
main.c:1:53: error: subscripted value is neither array nor pointer nor vector
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                                     ^
main.c:1:57: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                                         ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
main.c:1:57: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                                         ^~~~
main.c:1:57: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:63: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                                               ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
main.c:1:68: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
    1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
      |                                                                    ^~
      |                                                                    |
      |                                                                    int *
main.c:1:68: note: expected 'const char *' but argument is of type 'int *'
Language: C

p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
      |   ^~~~
main.c: In function 'main':
main.c:1:3: error: type of 's' defaults to 'int' [-Wimplicit-int]
main.c:1:3: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:3: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
      |                     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
      |                     ^~~~~
main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:58: error: expected ')' before 's'
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
      |                  ~                                       ^
      |                                                          )
main.c:1:90: error: expected expression before '}' token
    1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
      |                                                                                          ^
Language: C

#include<stdio.h>
int change(char s){
  if(s=='A')return 0;
  if(s=='B')return 1;
  if(s=='C')return 2;
  return -1;
}
main(){
  int cup[3]={1,0,0};
  char x,y;
  int tmp;
  while(~scanf("%c,%c",&x,&y)){
    tmp=cup[change(x)];
    cup[change(x)]=cup[change(y)];
    cup[change(y)]=tmxp;
  }
  if(cup[0])printf("A\n");
  if(cup[1])printf("B\n");
  if(cup[2])printf("C\n");
  return 0;
}

Compiler output:
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
    8 | main(){
      | ^~~~
main.c: In function 'main':
main.c:15:20: error: 'tmxp' undeclared (first use in this function); did you mean 'tmp'?
   15 |     cup[change(y)]=tmxp;
      |                    ^~~~
      |                    tmp
main.c:15:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include <stdio.h>
#include <stdbool.h>

#define conv(c) (int)(c-'A')

void swap(bool *cup1, bool *cup2)
{
  bool tmp = *cup1;
  *cup1 = *cup2;
  *cup2 = tmp;
}

int main()
{
  char input_cup[10];
  bool cups[3] = {true, false, false};

  // while(~scanf("%c,%c", &cup1, &cup2))
  while(fgets(input_cup, sizeof in/sizeof in[0], stdin))
    swap(&cups[conv(cup1)], &cups[conv(cup2)]);

  int i;
  for(i = 0; i < 3; ++i)
    if(cups[i]){
      printf("%c\n", (char)('A'+i));
      break;
    }

  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:19:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
   19 |   while(fgets(input_cup, sizeof in/sizeof in[0], stdin))
      |         ^~~~~
main.c:19:33: error: 'in' undeclared (first use in this function); did you mean 'int'?
   19 |   while(fgets(input_cup, sizeof in/sizeof in[0], stdin))
      |                                 ^~
      |                                 int
main.c:19:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:50: error: 'stdin' undeclared (first use in this function)
   19 |   while(fgets(input_cup, sizeof in/sizeof in[0], stdin))
      |                                                  ^~~~~
main.c:3:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
    2 | #include <stdbool.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:20:5: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |     ^~~~
main.c:20:21: error: 'cup1' undeclared (first use in this function); did you mean 'cups'?
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                     ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
main.c:20:40: error: 'cup2' undeclared (first use in this function); did you mean 'cups'?
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                                        ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
main.c:25:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |       printf("%c\n", (char)('A'+i));
      |       ^~~~~~
main.c:25:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:7: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <stdbool.h>

#define conv(c) (int)(c-'A')

void swap(bool *cup1, bool *cup2)
{
  bool tmp = *cup1;
  *cup1 = *cup2;
  *cup2 = tmp;
}

int main()
{
  char input_cup[10];
  bool cups[3] = {true, false, false};

  // while(~scanf("%c,%c", &cup1, &cup2))
  while(fgets(input_cup, sizeof in/sizeof in[0], stdin)!=NULL)
    swap(&cups[conv(cup1)], &cups[conv(cup2)]);

  int i;
  for(i = 0; i < 3; ++i)
    if(cups[i]){
      printf("%c\n", (char)('A'+i));
      break;
    }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:33: error: 'in' undeclared (first use in this function); did you mean 'int'?
   19 |   while(fgets(input_cup, sizeof in/sizeof in[0], stdin)!=NULL)
      |                                 ^~
      |                                 int
main.c:19:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:21: error: 'cup1' undeclared (first use in this function); did you mean 'cups'?
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                     ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
main.c:20:40: error: 'cup2' undeclared (first use in this function); did you mean 'cups'?
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                                        ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
Language: C

#include <stdio.h>
#include <stdbool.h>

#define conv(c) (int)(c-'A')

void swap(bool *cup1, bool *cup2)
{
  bool tmp = *cup1;
  *cup1 = *cup2;
  *cup2 = tmp;
}

int main()
{
  char input_cup[10];
  bool cups[3] = {true, false, false};

  // while(~scanf("%c,%c", &cup1, &cup2))
  while(fgets(input_cup, sizeof input_cup/sizeof input_cup[0], stdin)!=NULL)
    swap(&cups[conv(cup1)], &cups[conv(cup2)]);

  int i;
  for(i = 0; i < 3; ++i)
    if(cups[i]){
      printf("%c\n", (char)('A'+i));
      break;
    }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:21: error: 'cup1' undeclared (first use in this function); did you mean 'cups'?
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                     ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
main.c:20:21: note: each undeclared identifier is reported only once for each function it appears in
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                     ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
main.c:20:40: error: 'cup2' undeclared (first use in this function); did you mean 'cups'?
   20 |     swap(&cups[conv(cup1)], &cups[conv(cup2)]);
      |                                        ^~~~
main.c:4:23: note: in definition of macro 'conv'
    4 | #define conv(c) (int)(c-'A')
      |                       ^
Language: C

#include <stdio.h>
#include <math.h>

int main(){
	char x[1], y[1];
	int a[3], z, i, j;
	a[0] = 1;
	a[1] = a[2] = 0;
	while(scanf("%s,%s", &x[0], &y[0]) != EOF){
		if(x[0] == 'A') i = 0;
		if(x[0] == 'B') i = 1;
		if(x[0] == 'C') i = 2;
		if(y[0] == 'A') j = 0;
		if(y[0] == 'B') j = 1;
		if(y[0] == 'C') j = 2;
		z = a[i];
		a[i] = a[j];
		a[j] = z;
	}
	if(a[0] == 1) printf("%s\n", A);
	if(a[1] == 1) printf("%s\n", B);
	if(a[2] == 1) printf("%s\n", C);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:38: error: 'A' undeclared (first use in this function)
   20 |         if(a[0] == 1) printf("%s\n", A);
      |                                      ^
main.c:20:38: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:38: error: 'B' undeclared (first use in this function)
   21 |         if(a[1] == 1) printf("%s\n", B);
      |                                      ^
main.c:22:38: error: 'C' undeclared (first use in this function)
   22 |         if(a[2] == 1) printf("%s\n", C);
      |                                      ^
Language: C++

#include<iostream>
#include<ios>
using namespace std;
char c='A'm\,a,b;
main()
{
    while(~scanf("%c,%c\n",&a,&b))
    {
        if(a==c)c=b;
    }
    printf("%c\n",c);
}


Compiler output:
a.cc:4:12: error: stray '\' in program
    4 | char c='A'm\,a,b;
      |            ^
a.cc:4:8: error: unable to find character literal operator 'operator""m' with 'char' argument
    4 | char c='A'm\,a,b;
      |        ^~~~
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:29: error: 'a' was not declared in this scope
    7 |     while(~scanf("%c,%c\n",&a,&b))
      |                             ^
a.cc:7:32: error: 'b' was not declared in this scope
    7 |     while(~scanf("%c,%c\n",&a,&b))
      |                                ^
Language: C++

#include<iostream>

using namespace std;

int main(){
    int a=1,b=0,c=0,tmp;
    char x,y;
    while(cin>>x>>y){
        if(x=="A"){
            if(y=="B"){
                tmp = a;
                a = b;
                b = tmp;
            }else{
                tmp = a;
                a = c;
                c = tmp;
            }
        }else if(x=="B"){
            if(y=="A"){
                tmp = a;
                a = b;
                b = tmp;
            }else{
                tmp = b;
                b = c;
                c = tmp;
            }
        }else{
            if(y=="A"){
                tmp = a;
                a = c;
                c = tmp;
            }else{
                tmp = b;
                b = c;
                c = tmp;
            }
        }
    }
    if(a==1){
        cout << "A" << endl;
    }else if(b==1){
        cout << "B" << endl;
    }else{
        cout << "C" << endl;
    }
}
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(x=="A"){
      |            ~^~~~~
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |             if(y=="B"){
      |                ~^~~~~
a.cc:19:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |         }else if(x=="B"){
      |                  ~^~~~~
a.cc:20:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |             if(y=="A"){
      |                ~^~~~~
a.cc:30:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |             if(y=="A"){
      |                ~^~~~~
a.cc: At global scope:
a.cc:49:5: error: expected declaration before '}' token
   49 |     }
      |     ^
Language: C++

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

int main() {
    int A = 1;
    int B = 0;
    int C = 0;
    while(true){
        string s;
        cin >> s;
        if (s[0]=='A'){
           if(s[2]=='B'){
               int tmp;
               tmp = B;
               B = A;
               A = tmp;
           }
           else if(s[2]=='C'){
               int tmp;
               tmp = C;
               C = A;
               A = tmp;
           }
           }
        if (s[0]=='B'){
           if(s[2]=='A'){
               int tmp;
               tmp = A;
               A = B;
               B = tmp;
           }
           else if(s[2]=='C'){
               int tmp;
               tmp = C;
               C = B;
               B = tmp;
           }
           }
        else if (s[0]=='C'){
            if(s[2]=='A'){
               int tmp;
               tmp = A;
               A = C;
               C = tmp;
           }
           else if(s[2]=='B'){
               int tmp;
               tmp = B;
               B = C;
               C = tmp;
           }
           }
    }
    if (A==1){
        cout << "A" << endl;
    }
    else if (B==1){
        cout << "B" << endl;
    }
    else if (c==1){
        cout << "C" << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:14: error: 'c' was not declared in this scope
   61 |     else if (c==1){
      |              ^
Language: C++

#include<iostream>

using namespace std;

int main(){
	int A,B,C,x,y,s,t,u;
	A=1,B=2,C=3;
	while(cin>>x","y){
		if((x==A && y==B)||(x==B && y==A)){
			s=A;
			A=B;
			B=z;
		}else if((x==B && y==C)||(x==C && y==B)){
			t=B;
			B=C;
			C=t;
		}else if((x==C && y==A)||(x==A && y==C)){
			u=C;
			C=A;
			A=u;
		}
	}
	if(A==1){A=A}
	else if(A==2){A=B}
	else if(A==3){A=C};
	cout << A << endl;
}
			


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: expected ')' before user-defined string literal
    8 |         while(cin>>x","y){
      |              ~      ^~~~
      |                     )
a.cc:8:21: error: unable to find string literal operator 'operator""y' with 'const char [2]', 'long unsigned int' arguments
    8 |         while(cin>>x","y){
      |                     ^~~~
a.cc:23:21: error: expected ';' before '}' token
   23 |         if(A==1){A=A}
      |                     ^
      |                     ;
a.cc:24:26: error: expected ';' before '}' token
   24 |         else if(A==2){A=B}
      |                          ^
      |                          ;
a.cc:25:26: error: expected ';' before '}' token
   25 |         else if(A==3){A=C};
      |                          ^
      |                          ;
Language: C++

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

int main() {
    int A = 1;
    int B = 0;
    int C = 0;
    string s;
    while(cin >> s){
        if (s[0]=='A'){
           if(s[2]=='B'){
               int tmp;
               tmp = B;
               B = A;
               A = tmp;
           }
           else if(s[2]=='C'){
               int tmp;
               tmp = C;
               C = A;
               A = tmp;
           }
           }
        if (s[0]=='B'){
           if(s[2]=='A'){
               int tmp;
               tmp = A;
               A = B;
               B = tmp;
           }
           else if(s[2]=='C'){
               int tmp;
               tmp = C;
               C = B;
               B = tmp;
           }
           }
        else if (s[0]=='C'){
            if(s[2]=='A'){
               int tmp;
               tmp = A;
               A = C;
               C = tmp;
           }
           else if(s[2]=='B'){
               int tmp;
               tmp = B;
               B = C;
               C = tmp;
           }
           }
    }
    if (A==1){
        cout << "A" << endl;
    }
    else if (B==1){
        cout << "B" << endl;
    }
    else if (c==1){
        cout << "C" << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:14: error: 'c' was not declared in this scope
   60 |     else if (c==1){
      |              ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  char x,y,z;
  int i,n;
  for(i=0;i<=n;++i){
  cin >> x >> y;
  if (x==A){
    z=x;
  } else if(y==A){
    z=y;
  } else {
    z=z;
  }
    
} cout << z << endl;
return 0;}



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

#include<stdio.h>

int main(){
char x,y,T=A,tmp;
while(scanf("%c,%c",&x,&y)!=EOF{
if(x==T)T=y;
else if(y==T)T=x;
}
printf("%c\n",T);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: 'A' was not declared in this scope
    4 | char x,y,T=A,tmp;
      |            ^
a.cc:5:32: error: expected ')' before '{' token
    5 | while(scanf("%c,%c",&x,&y)!=EOF{
      |      ~                         ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
    int a,b;
    char cup1,cup2,abc[2][3]={{'A','B','C'},{'1','0','0'}};
    while(scanf("%c,%c",&cup1,&cup2)!EOF){
        for(int i=0;i<3;i++){
            if(abc[0][i]==cup1) a=i;
            if(abc[0][i]==cup2) b=i;
        }
        swap(abc[1][a],abc[1][b]);
    }
    for(int i=0;i<3;i++){
        if(abc[1][i]=='1'){
            printf("%c\n",abc[0][i]);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:37: error: expected ')' before '!' token
    8 |     while(scanf("%c,%c",&cup1,&cup2)!EOF){
      |          ~                          ^
      |                                     )
a.cc:8:41: error: expected ';' before ')' token
    8 |     while(scanf("%c,%c",&cup1,&cup2)!EOF){
      |                                         ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
    int cup[3] = {1};
    int x, y;
    while (scanf(" %d,%d", &x, &y) != EOF)
    {
        swap(cup[a - 'A'], cup[b - 'A']);
    }
    for (int i = 0; i < 3; i++)
    {
        if (cup[i] > 0)
        {
            printf("%c\n", 'A' + i);
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'a' was not declared in this scope
   10 |         swap(cup[a - 'A'], cup[b - 'A']);
      |                  ^
a.cc:10:32: error: 'b' was not declared in this scope
   10 |         swap(cup[a - 'A'], cup[b - 'A']);
      |                                ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int i, j, tmp, a[3]={1, 0, 0};
	char s1, s2, kanma;
	
	
	while(1){
		cin>>s1>>kanma>>s2;
		if(cin.eof())break;

		if(s1=='A'||s2=='A'){
			i=0;
			if(s1=='B'||s2=='B')
				j=1;
			else 
				j=2;
		}
		else if(s1=='B'||s2=='B'){
			i=1;
			if(s1=='C'||s2=='C')
				j=2;
			else
				j=0;
		}
		else if(s1=='C'||s2=='C'){
			i=2;
			if(s1=='A'||s2=='A')
				j=0;
			else
				j=1;
		}

		tmp=a[i];
		a[i]=a[j];
		a[j]=tmp;
	}

	if(a[0]==1)
		cout<<"A\n";
	else if(a[1]==1)
		cout<<"B\n";
	else if(a[2]==1)
		cout<<"C\n";

	return 0;

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

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

int main()
{
	char x, y;
	string str;
	int posi = 1;
	while (cin >> str) {
		x = str[0];
		y = str[2];
		(char)x = min((int)x, (int)y);
		(char)y = max((int)x, (int)y);

		if (posi == 1) {
			if (x == 'A' && y == 'B')posi = 2;
			else if (x == 'A' && y == 'C')posi = 3;
		}
		else if (posi == 2) {
			if (x == 'A' && y == 'B')posi = 1;
			else if (x == 'B' && y == 'C')posi = 3;
		}
		else if (posi == 3) {
			if (x == 'A' && y == 'C')posi = 1;
			else if (x == 'B' && y == 'C')posi = 2;
		}
	}
	//cout << (posi == 1 ? "A" : (posi == 2 ? "B" : "C")) << endl;
	if (posi == 1)cout << "A" << endl;
	else if (posi == 2)cout << "B" << endl;
	else if (posi == 3)cout << "C" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: lvalue required as left operand of assignment
   14 |                 (char)x = min((int)x, (int)y);
      |                 ^~~~~~~
a.cc:15:17: error: lvalue required as left operand of assignment
   15 |                 (char)y = max((int)x, (int)y);
      |                 ^~~~~~~
Language: C++

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

int main()
{
	char x, y;
	string str;
	int posi = 1;
	while (cin >> str) {
		x = str[0];
		y = str[2];
		(char)x = min((int)x, (int)y);
		//(char)y = max((int)x, (int)y);



		if (posi == 1) {
			if (x == 'A' && y == 'B')posi = 2;
			else if (x == 'A' && y == 'C')posi = 3;
		}
		else if (posi == 2) {
			if (x == 'A' && y == 'B')posi = 1;
			else if (x == 'B' && y == 'C')posi = 3;
		}
		else if (posi == 3) {
			if (x == 'A' && y == 'C')posi = 1;
			else if (x == 'B' && y == 'C')posi = 2;
		}
	}
	if (posi == 1)cout << "A" << endl;
	else if (posi == 2)cout << "B" << endl;
	else if (posi == 3)cout << "C" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: lvalue required as left operand of assignment
   14 |                 (char)x = min((int)x, (int)y);
      |                 ^~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
	map<char, int> cup;
	cup['A'] = 1;
	cup['B'] = 0;
	cup['C'] = 0;
	char c1, c2, delim;
	while( cin >> c1 >> delim >> c2 ){
		swap(cup['c1'] , cup['c2']);
	}
	if(	cup['A'] = 1) cout << A << '?\n';
	if(	cup['B'] = 1) cout << B << '?\n';
	if(	cup['C'] = 1) cout << C << '?\n';
}

Compiler output:
a.cc:12:26: warning: multi-character character constant [-Wmultichar]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                          ^~~~
a.cc:12:38: warning: multi-character character constant [-Wmultichar]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                                      ^~~~
a.cc:14:44: warning: multi-character character constant [-Wmultichar]
   14 |         if(     cup['A'] = 1) cout << A << '?\n';
      |                                            ^~~~~
a.cc:15:44: warning: multi-character character constant [-Wmultichar]
   15 |         if(     cup['B'] = 1) cout << B << '?\n';
      |                                            ^~~~~
a.cc:16:44: warning: multi-character character constant [-Wmultichar]
   16 |         if(     cup['C'] = 1) cout << C << '?\n';
      |                                            ^~~~~
a.cc: In function 'int main()':
a.cc:12:26: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25393' to '49' [-Woverflow]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                          ^~~~
a.cc:12:38: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25394' to '50' [-Woverflow]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                                      ^~~~
a.cc:14:39: error: 'A' was not declared in this scope
   14 |         if(     cup['A'] = 1) cout << A << '?\n';
      |                                       ^
a.cc:15:39: error: 'B' was not declared in this scope
   15 |         if(     cup['B'] = 1) cout << B << '?\n';
      |                                       ^
a.cc:16:39: error: 'C' was not declared in this scope
   16 |         if(     cup['C'] = 1) cout << C << '?\n';
      |                                       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
	map<char, int> cup;
	cup['A'] = 1;
	cup['B'] = 0;
	cup['C'] = 0;
	char c1, c2, delim;
	while( cin >> c1 >> delim >> c2 ){
		swap(cup['c1'] , cup['c2']);
	}
	if(	cup['A'] == 1) cout << A << '?\n';
	if(	cup['B'] == 1) cout << B << '?\n';
	if(	cup['C'] == 1) cout << C << '?\n';
}

Compiler output:
a.cc:12:26: warning: multi-character character constant [-Wmultichar]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                          ^~~~
a.cc:12:38: warning: multi-character character constant [-Wmultichar]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                                      ^~~~
a.cc:14:45: warning: multi-character character constant [-Wmultichar]
   14 |         if(     cup['A'] == 1) cout << A << '?\n';
      |                                             ^~~~~
a.cc:15:45: warning: multi-character character constant [-Wmultichar]
   15 |         if(     cup['B'] == 1) cout << B << '?\n';
      |                                             ^~~~~
a.cc:16:45: warning: multi-character character constant [-Wmultichar]
   16 |         if(     cup['C'] == 1) cout << C << '?\n';
      |                                             ^~~~~
a.cc: In function 'int main()':
a.cc:12:26: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25393' to '49' [-Woverflow]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                          ^~~~
a.cc:12:38: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25394' to '50' [-Woverflow]
   12 |                 swap(cup['c1'] , cup['c2']);
      |                                      ^~~~
a.cc:14:40: error: 'A' was not declared in this scope
   14 |         if(     cup['A'] == 1) cout << A << '?\n';
      |                                        ^
a.cc:15:40: error: 'B' was not declared in this scope
   15 |         if(     cup['B'] == 1) cout << B << '?\n';
      |                                        ^
a.cc:16:40: error: 'C' was not declared in this scope
   16 |         if(     cup['C'] == 1) cout << C << '?\n';
      |                                        ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
int main(){
	map<string, int> cup;
	cup["A"] = 1;
	cup["B"] = 0;
	cup["C"] = 0;
	char c1, c2, delim;
	while( cin >> c1 >> delim >> c2 ){
		swap(cup["c1"] , cup["c2"]);
	}
	if(cup["A"] == 1) cout << A << '?\n';
	if(cup["B"] == 1) cout << B << '?\n';
	if(cup["C"] == 1) cout << C << '?\n';
}

Compiler output:
a.cc:15:40: warning: multi-character character constant [-Wmultichar]
   15 |         if(cup["A"] == 1) cout << A << '?\n';
      |                                        ^~~~~
a.cc:16:40: warning: multi-character character constant [-Wmultichar]
   16 |         if(cup["B"] == 1) cout << B << '?\n';
      |                                        ^~~~~
a.cc:17:40: warning: multi-character character constant [-Wmultichar]
   17 |         if(cup["C"] == 1) cout << C << '?\n';
      |                                        ^~~~~
a.cc: In function 'int main()':
a.cc:15:35: error: 'A' was not declared in this scope
   15 |         if(cup["A"] == 1) cout << A << '?\n';
      |                                   ^
a.cc:16:35: error: 'B' was not declared in this scope
   16 |         if(cup["B"] == 1) cout << B << '?\n';
      |                                   ^
a.cc:17:35: error: 'C' was not declared in this scope
   17 |         if(cup["C"] == 1) cout << C << '?\n';
      |                                   ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
int main(){
	map<string, int> cup;
	cup["A"] = 1;
	cup["B"] = 0;
	cup["C"] = 0;
	string c1, c2;
	char delim;
	while( cin >> c1 >> delim >> c2 ){
		swap(cup["c1"] , cup["c2"]);
	}
	if(cup["A"] == 1) cout << A << '?\n';
	if(cup["B"] == 1) cout << B << '?\n';
	if(cup["C"] == 1) cout << C << '?\n';
}

Compiler output:
a.cc:16:40: warning: multi-character character constant [-Wmultichar]
   16 |         if(cup["A"] == 1) cout << A << '?\n';
      |                                        ^~~~~
a.cc:17:40: warning: multi-character character constant [-Wmultichar]
   17 |         if(cup["B"] == 1) cout << B << '?\n';
      |                                        ^~~~~
a.cc:18:40: warning: multi-character character constant [-Wmultichar]
   18 |         if(cup["C"] == 1) cout << C << '?\n';
      |                                        ^~~~~
a.cc: In function 'int main()':
a.cc:16:35: error: 'A' was not declared in this scope
   16 |         if(cup["A"] == 1) cout << A << '?\n';
      |                                   ^
a.cc:17:35: error: 'B' was not declared in this scope
   17 |         if(cup["B"] == 1) cout << B << '?\n';
      |                                   ^
a.cc:18:35: error: 'C' was not declared in this scope
   18 |         if(cup["C"] == 1) cout << C << '?\n';
      |                                   ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
int main(){
	map<string, int> cup;
	cup["A"] = 1;
	cup["B"] = 0;
	cup["C"] = 0;
	char c1, c2, delim;
	while( cin >> c1 >> delim >> c2 ){
		swap(cup["c1"] , cup["c2"]);
	}
	cout << cup.at(1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: no matching function for call to 'std::map<std::__cxx11::basic_string<char>, int>::at(int)'
   15 |         cout << cup.at(1) << endl;
      |                 ~~~~~~^~~
In file included from /usr/include/c++/14/map:63,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_map.h:549:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  549 |       at(const key_type& __k)
      |       ^~
/usr/include/c++/14/bits/stl_map.h:549:26: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  549 |       at(const key_type& __k)
      |          ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:558:7: note: candidate: 'const std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  558 |       at(const key_type& __k) const
      |       ^~
/usr/include/c++/14/bits/stl_map.h:558:26: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  558 |       at(const key_type& __k) const
      |          ~~~~~~~~~~~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	char c1, c2, delim, ball = 'A';
	while(cin >> c1 >> delim >> c2){
		if(ball == c1) ball == c2;
		else if(ball == c2) ball == c1;	
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

import sys

def convert(s):
    x = 0
    if s == "A":
        x = 0
    elif s == "B":
        x = 1
    elif s == "C":
        x = 2
    return x

def main():
    A = [0 for i in range(3)]
    A[0] = 1

    for line in sys.stdin:
        B = line.split(",")
        B[0] = convert(B[0])
        B[1] = B[1].replace("\n", "")
        B[1] = convert(B[1])

        tmp = A[B[0]]
        A[B[0]] = A[B[1]]
        A[B[1]] = tmp
    
    S = ["A", "B", "C"]
    for i in range(3):
        if A[i] == 1:
            print(S[i])


if __name__ == "__main__":
    main()


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

#include<iostream>
#include<string>

using namespace std;

int main()
{
  int cup[3] = {1,0,0};
  string cupab("A,B");
  string cupba("B,A");
  string cupac("A,C");
  string cupca("C,A");
  string cupbc("B,C");
  string cupcb("C,B"); 
  string swapping;

  while (cin >> swapping){
    int temp;
    if(swapping == cupab || swapping == cupba){
      temp = cup[0];
      cup[0] = cup[1];
      cup[1] = temp;
    }
    else if(swapping == cupac || swapping == cupca){
      temp = cup[0];
      cup[0] = cup[2];
      cup[2] = temp;
    }
    else if(swapping == cupbc || swapping == cupcb){
      temp = cup[1];
      cup[1] = cup[2];
      cup[2] = temp;
    }
    cout<<cup[0]<<cup[1]<<cup[2]<<endl;
  }
  
  if(cup[0] == 1){
    cout<<"A"<<endl;
  }
  else if(cup[1] == 1){
    cout<<"B"<<endl;
  }
  else if(cup[2] == 1){
    cout<<"C"<<endl;
  }

  return 0;
}#include<iostream>
#include<string>

using namespace std;

int main()
{
  int cup[3] = {1,0,0};
  string cupab("A,B");
  string cupba("B,A");
  string cupac("A,C");
  string cupca("C,A");
  string cupbc("B,C");
  string cupcb("C,B"); 
  string swapping;

  while (cin >> swapping){
    int temp;
    if(swapping == cupab || swapping == cupba){
      temp = cup[0];
      cup[0] = cup[1];
      cup[1] = temp;
    }
    else if(swapping == cupac || swapping == cupca){
      temp = cup[0];
      cup[0] = cup[2];
      cup[2] = temp;
    }
    else if(swapping == cupbc || swapping == cupcb){
      temp = cup[1];
      cup[1] = cup[2];
      cup[2] = temp;
    }
    cout<<cup[0]<<cup[1]<<cup[2]<<endl;
  }
  
  if(cup[0] == 1){
    cout<<"A"<<endl;
  }
  else if(cup[1] == 1){
    cout<<"B"<<endl;
  }
  else if(cup[2] == 1){
    cout<<"C"<<endl;
  }

  return 0;
}


Compiler output:
a.cc:48:2: error: stray '#' in program
   48 | }#include<iostream>
      |  ^
a.cc:48:3: error: 'include' does not name a type
   48 | }#include<iostream>
      |   ^~~~~~~
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main()
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main()
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-9;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
    char a,b;
    int ans=0;
    char c[3]={'A','B','C'};
    while(scanf("%c,%c",a,b)){
        nt aa,bb;
        if(a=='A'){
            aa=0;
        }else if(a=='B'){
            aa=1;
        }else{
            aa=2;
        }
        if(b=='A'){
            bb=0;
        }else if(b=='B'){
            bb=1;
        }else{
            bb=2;
        }
        if(aa==ans){
            ans=bb;
        }else if(bb==ans){
            ans=aa;
        }
    }
    cout<<c[ans]<<endl;
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'nt' was not declared in this scope; did you mean 'int'?
   18 |         nt aa,bb;
      |         ^~
      |         int
a.cc:20:13: error: 'aa' was not declared in this scope; did you mean 'a'?
   20 |             aa=0;
      |             ^~
      |             a
a.cc:22:13: error: 'aa' was not declared in this scope; did you mean 'a'?
   22 |             aa=1;
      |             ^~
      |             a
a.cc:24:13: error: 'aa' was not declared in this scope; did you mean 'a'?
   24 |             aa=2;
      |             ^~
      |             a
a.cc:27:13: error: 'bb' was not declared in this scope; did you mean 'b'?
   27 |             bb=0;
      |             ^~
      |             b
a.cc:29:13: error: 'bb' was not declared in this scope; did you mean 'b'?
   29 |             bb=1;
      |             ^~
      |             b
a.cc:31:13: error: 'bb' was not declared in this scope; did you mean 'b'?
   31 |             bb=2;
      |             ^~
      |             b
a.cc:33:12: error: 'aa' was not declared in this scope; did you mean 'a'?
   33 |         if(aa==ans){
      |            ^~
      |            a
a.cc:34:17: error: 'bb' was not declared in this scope; did you mean 'b'?
   34 |             ans=bb;
      |                 ^~
      |                 b
a.cc:35:18: error: 'bb' was not declared in this scope; did you mean 'b'?
   35 |         }else if(bb==ans){
      |                  ^~
      |                  b
Language: C++

#include <iostream>
using namespace std;
int main(){
  int a[3]={1,0,0},b;char c[3];
  while(cin>>c){
    b=a[(c[0]-'A')];
    a[c[0]-'A']=a[(c[2]-'A')];
    a[(c[2]-'A')]=b;
  }
  for(b=0;i<3;i++)if(a[i])cout<<(char)('A'+i)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'i' was not declared in this scope
   10 |   for(b=0;i<3;i++)if(a[i])cout<<(char)('A'+i)<<endl;
      |           ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	char k;
	string a="A",b="B",c="C"
	int i,j,A=1,B=0,C=0;
	while(cin>>i>>k>>j){
		if((i =='A' && j=='B')||(i=='B' && j=='A')) swap(A,B);
		if((i =='B' && j=='C')||(i=='C' && j=='B')) swap(B,C);
		if((i =='A' && j=='C')||(i=='C' && j=='A')) swap(A,C);
	}
	if(A==1) cout<<a<<endl;
	else if(B==1) cout<<b<<endl;
	else if(C==1) cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected ',' or ';' before 'int'
    8 |         int i,j,A=1,B=0,C=0;
      |         ^~~
a.cc:9:20: error: 'i' was not declared in this scope
    9 |         while(cin>>i>>k>>j){
      |                    ^
a.cc:9:26: error: 'j' was not declared in this scope
    9 |         while(cin>>i>>k>>j){
      |                          ^
a.cc:10:66: error: 'A' was not declared in this scope
   10 |                 if((i =='A' && j=='B')||(i=='B' && j=='A')) swap(A,B);
      |                                                                  ^
a.cc:10:68: error: 'B' was not declared in this scope
   10 |                 if((i =='A' && j=='B')||(i=='B' && j=='A')) swap(A,B);
      |                                                                    ^
a.cc:11:66: error: 'B' was not declared in this scope
   11 |                 if((i =='B' && j=='C')||(i=='C' && j=='B')) swap(B,C);
      |                                                                  ^
a.cc:11:68: error: 'C' was not declared in this scope
   11 |                 if((i =='B' && j=='C')||(i=='C' && j=='B')) swap(B,C);
      |                                                                    ^
a.cc:12:66: error: 'A' was not declared in this scope
   12 |                 if((i =='A' && j=='C')||(i=='C' && j=='A')) swap(A,C);
      |                                                                  ^
a.cc:12:68: error: 'C' was not declared in this scope
   12 |                 if((i =='A' && j=='C')||(i=='C' && j=='A')) swap(A,C);
      |                                                                    ^
a.cc:14:12: error: 'A' was not declared in this scope
   14 |         if(A==1) cout<<a<<endl;
      |            ^
a.cc:15:17: error: 'B' was not declared in this scope
   15 |         else if(B==1) cout<<b<<endl;
      |                 ^
a.cc:16:17: error: 'C' was not declared in this scope
   16 |         else if(C==1) cout<<c<<endl;
      |                 ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
    char c[5];
    char n[] = "A";
    while(cin>>c){
        if(c[0]==n[0]) n[0] = c[2];
        else if( c[2] == n[0] ) n[0] = c[0];
    }
    putchar(n[0]);
    putcharendl);
    return 0;
}

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

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

int a[3];

int main()
{
	a[0] = 1;
	char c1,c2;
	while(cin >> c1){
		cin.ignore();
		cin >> c2;
		swap(a[c1 - 'A'],a[c2 - 'A']);
	}
	}
	for(int i = 0; i < 3; ++i){
		if(a[i])cout << (char)('A' + i) << endl;
	}
}

Compiler output:
a.cc:17:9: error: expected unqualified-id before 'for'
   17 |         for(int i = 0; i < 3; ++i){
      |         ^~~
a.cc:17:24: error: 'i' does not name a type
   17 |         for(int i = 0; i < 3; ++i){
      |                        ^
a.cc:17:31: error: expected unqualified-id before '++' token
   17 |         for(int i = 0; i < 3; ++i){
      |                               ^~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	string str;
	ch n,m;
	int a=1,b=0,c=0,d;
	while(cin>>str){
		n=str[0];m=str[2];
		if(n=='A'&&m=='B'){
			d=a;a=b;b=d;
		}else if(n=='A'&&m=='C'){
			d=a;a=c;c=d;
		}else if(n=='B'&&m=='A'){
			d=b;b=a;a=d;
		}else if(n=='B'&&m=='C'){
			d=b;b=c;c=d;
		}else if(n=='C'&&m=='A'){
			d=c;c=a;a=d;
		}else{
			d=c;c=b;b=d;
		}
	}
	if(a)cout<<'A'<<endl;
	if(b)cout<<'B'<<endl;
	if(c)cout<<'C'<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'ch' was not declared in this scope
    5 |         ch n,m;
      |         ^~
a.cc:8:17: error: 'n' was not declared in this scope
    8 |                 n=str[0];m=str[2];
      |                 ^
a.cc:8:26: error: 'm' was not declared in this scope
    8 |                 n=str[0];m=str[2];
      |                          ^
Language: C++

using namespace std;

int main(){
	bool existBall[3] = { 1, 0, 0 };
	bool tm;

	char a, b;
	string s;

	while (getline(cin, s), s != "\0"){
		a = s[0];
		b = s[2];
		
		tm = existBall[b - 'A'];
		existBall[b - 'A'] = existBall[a - 'A'];
		existBall[a - 'A'] = tm;

	}
	
	s = "";
	for (int i = 0; i < 3;++i)
	if (existBall[i])
		cout << s + (char)('A' + i) << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'string' was not declared in this scope
    8 |         string s;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:10:24: error: 'cin' was not declared in this scope
   10 |         while (getline(cin, s), s != "\0"){
      |                        ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:29: error: 's' was not declared in this scope
   10 |         while (getline(cin, s), s != "\0"){
      |                             ^
a.cc:10:16: error: 'getline' was not declared in this scope
   10 |         while (getline(cin, s), s != "\0"){
      |                ^~~~~~~
a.cc:20:9: error: 's' was not declared in this scope
   20 |         s = "";
      |         ^
a.cc:23:17: error: 'cout' was not declared in this scope
   23 |                 cout << s + (char)('A' + i) << endl;
      |                 ^~~~
a.cc:23:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:48: error: 'endl' was not declared in this scope
   23 |                 cout << s + (char)('A' + i) << endl;
      |                                                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			double x = sc.nextDouble();
			System.out.println(x<=48.00?"light fly":x<=51.00?"fly":x<=54.00?"bantam":x<=57.00?"feather":
                                           x<=60.00?"light":x<=64.00?"light welter":x<=69.00?"welter":
                                           x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":x>=91.00?"heavy");
		}
	}
}

Compiler output:
Main.java:11: error: : expected
                                           x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":x>=91.00?"heavy");
                                                                                                                            ^
1 error