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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,a,b,n,m;
  cin >> x >> a >> b;
  n=max(x,a)-min(x,a);
  m=max(x.b)-min(x,b);
  if(n<m){
    cout << "A" << endl;
  }
  else {
    cout << "B" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: request for member 'b' in 'x', which is of non-class type 'int'
    7 |   m=max(x.b)-min(x,b);
      |           ^
Language: C

#include <stdio.h>

int distance (int num1, int num2);
  
int main(void){
  int x, a, b;
  scanf( "%d %d %d", &x, &a, &b);
  int d1 = distance (x,a);
  int d2 = distance (x,b);
  if (d1>=d2){
    printf("A");
  }else {
    printf("B");
  }
  
  int distance (int num1, int num2){
    int dis;
    if (num1 > num2){
      dis = num1 - num2;
    } else {
      dis = num2 - num1;
    }
    return dis;
  }


Compiler output:
main.c: In function 'main':
main.c:24:3: error: expected declaration or statement at end of input
   24 |   }
      |   ^
Language: C

#include <stdio.h>

int distance (int num1, int num 2);
  
int main(void){
  int x, a, b;
  scanf( "%d %d %d", &x, &a, &b);
  int d1 = distance (x,a);
  int d2 = distance (x,b);
  if (d1>=d2){
    printf("A");
  }else {
    printf("B");
  }
  
  int distance (int num1, int num2){
    int dis;
    if (num1 > num2){
      dis = num1 - num2;
    } else {
      dis = num2 - num1;
    }
    return dis;
  }


Compiler output:
main.c:3:33: error: expected ';', ',' or ')' before numeric constant
    3 | int distance (int num1, int num 2);
      |                                 ^
main.c: In function 'main':
main.c:8:12: error: implicit declaration of function 'distance' [-Wimplicit-function-declaration]
    8 |   int d1 = distance (x,a);
      |            ^~~~~~~~
main.c:16:7: error: static declaration of 'distance' follows non-static declaration
   16 |   int distance (int num1, int num2){
      |       ^~~~~~~~
main.c:8:12: note: previous implicit declaration of 'distance' with type 'int()'
    8 |   int d1 = distance (x,a);
      |            ^~~~~~~~
main.c:24:3: error: expected declaration or statement at end of input
   24 |   }
      |   ^
Language: C

#include <stdio.h>

int distance (int num1, int num 2);
  
int main(void){
  int x, a, b;
  scanf( "%d %d %d", &x, &a, &b);
  int d1 = distance (x,a);
  int d2 = distance (x,b);
  if (d1>=d2){
    printf("A");
  }else {
    printf("B");
  }
  
  int distance (int num1, int num 2){
    int dis;
    if (num1 > num2){
      dis = num1 - num2;
    } else {
      dis = num 2 - num 1;
    }
    return dis;
  }

Compiler output:
main.c:3:33: error: expected ';', ',' or ')' before numeric constant
    3 | int distance (int num1, int num 2);
      |                                 ^
main.c: In function 'main':
main.c:8:12: error: implicit declaration of function 'distance' [-Wimplicit-function-declaration]
    8 |   int d1 = distance (x,a);
      |            ^~~~~~~~
main.c:16:35: error: expected ';', ',' or ')' before numeric constant
   16 |   int distance (int num1, int num 2){
      |                                   ^
main.c:24:3: error: expected declaration or statement at end of input
   24 |   }
      |   ^
Language: C++

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

int main(){
  int A,B,C;
  cin >> A >> B >> C;
  int D = max(A,B) - min(A,B);
  int E = max(A,C) - min(A,C);
  if(D > E){
    cout << "B << endl;
  }
  else{
cout << "A" << endl;
  }
}


Compiler output:
a.cc:10:13: warning: missing terminating " character
   10 |     cout << "B << endl;
      |             ^
a.cc:10:13: error: missing terminating " character
   10 |     cout << "B << endl;
      |             ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:3: error: expected primary-expression before '}' token
   11 |   }
      |   ^
Language: C

#include<stdio.h>

int main()
{
 int a,b,x,s1,s2,t1,t2;

 scanf("%d%d%d",&x,&a,&b);

 if(x>a){s1=x;s2=a;}
  else {s1=a;s2=x;}
 if(x>b){t1=x;t2=b;}
  else {t1=b;t2=x}

 if((s1-s2)>(t1-t2))printf("B");
 else printf("A");

 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:18: error: expected ';' before '}' token
   12 |   else {t1=b;t2=x}
      |                  ^
      |                  ;
Language: C

#include<stdio.h>

int main()
{
 int a,b,x,s1,s2,t1,t2;

 scanf("%d%d%d",&x,&a,&b);

 if(x>a){s1=x;s2=a;}
  else {s1=a;a2=x;}
 if(x>b){t1=x;t2=b;}
  else {t1=b;t2=x}

 if((s1-s2)>(t1-t2))printf("B");
 else printf("A");

 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:14: error: 'a2' undeclared (first use in this function); did you mean 't2'?
   10 |   else {s1=a;a2=x;}
      |              ^~
      |              t2
main.c:10:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:18: error: expected ';' before '}' token
   12 |   else {t1=b;t2=x}
      |                  ^
      |                  ;
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int x = Math.abs(b-a);
    int y = Math.abs(c-a);
    System.out.println(x < y ? A : B);
  }
}


Compiler output:
Main.java:11: error: reference to println is ambiguous
    System.out.println(x < y ? A : B);
              ^
  both method println(char[]) in PrintStream and method println(String) in PrintStream match
Main.java:11: error: cannot find symbol
    System.out.println(x < y ? A : B);
                               ^
  symbol:   variable A
  location: class Main
Main.java:11: error: cannot find symbol
    System.out.println(x < y ? A : B);
                                   ^
  symbol:   variable B
  location: class Main
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x,a,b;
  cin >> x >>a >> b;
  
  if(ans(x-a)>abs(x-b)){
    cout << 'B' << endl;
  }else{
    cout << 'A' << endl;
  } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   if(ans(x-a)>abs(x-b)){
      |      ^~~
      |      abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int,string>;

int main() {
  int x,a,b;
  cin >> x >> a >> b;
  if(abs(x-a)>=abs(x-b)) cout << B << endl;
  else cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:34: error: 'B' was not declared in this scope
   10 |   if(abs(x-a)>=abs(x-b)) cout << B << endl;
      |                                  ^
a.cc:11:16: error: 'A' was not declared in this scope
   11 |   else cout << A << endl;
      |                ^
Language: C++

#include<iostream>
using namspace std;
int main(){
  int x, a, b;
  cin>>x>>a>>b;
  if (abs(x-a)>abs(x-b)){
    cout<<'B' << endl;
  }
  else{
    cout<<'A' << endl;
  }
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspace'
    2 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>x>>a>>b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |     cout<<'B' << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |     cout<<'B' << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout<<'A' << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     cout<<'A' << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
 
int main() {
    ios::sync_with_stdio(false);
	int x, a, b;
	cin >> x >> a >> b;
	if (abs(x - a) > abs(x - b)) cout << 'B';
	else cout << 'A'; 
}

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

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

int main(){
  int x,a,b,c,d;
  cin >> x >> a >> b;
  if(x<a){
    c=a-x;
  }
  else{
    c=x-a;
  }
  if(x<b){
    d=b-x;
  }
  else{
    d=x-b;
  }
  if(c<d){
    cout << A << endl;
  }
  else{
    cout << B << endl;
  }
}


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

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

int main(){
  int x,a,b;
  cin >> x >> a >> b;
  if(max(a-x,x-a)>max(b-x,x-b)) cout << "A" << endl;
  else cot << "B" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'cot' was not declared in this scope; did you mean 'cos'?
    8 |   else cot << "B" << endl;
      |        ^~~
      |        cos
Language: C++

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

int main(){
  int x.a.b;
  cin >> x >> a >> b;
  if( abs(x-a)>abs(x-b) ){
    cout << 'B' << endl;
  }else{
    cout << 'A' <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected initializer before '.' token
    6 |   int x.a.b;
      |        ^
a.cc:7:10: error: 'x' was not declared in this scope
    7 |   cin >> x >> a >> b;
      |          ^
a.cc:7:15: error: 'a' was not declared in this scope
    7 |   cin >> x >> a >> b;
      |               ^
a.cc:7:20: error: 'b' was not declared in this scope
    7 |   cin >> x >> a >> b;
      |                    ^
Language: C++

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

int main() {
 int x, a, b;
  cin >> x >> a >> b
    if(abs(x-a)>abs(x-b)) cout << "B" << endl;
  else cout << "A" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected ';' before 'if'
    6 |   cin >> x >> a >> b
      |                     ^
      |                     ;
    7 |     if(abs(x-a)>abs(x-b)) cout << "B" << endl;
      |     ~~               
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else cout << "A" << endl;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n); for(int i = 0;i < (n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
long double pi = acos(-1);
const int INF = 1001001001;


// 最小公倍数を求める
int euqlid (int a, int b){
  int temp;
  temp = a % b;
  if(temp == 0)return b;
  return euqlid(b,temp);
}
ll conbination(ll a,ll b){
  ll u = 1;
  ll d = 1;
  while(b != 0){
    u *= a;
    d *= b;
    a--;
    b--;
  }
  return u / d;
}
int strtoint(char s){
  return (int(s-'0'));
}
int fact(int n){
  if(n == 1)return 1;
  return n * fact(n-1);
  }


int main(){
  int x ,a,b;
  cin >> x >> a >> b;
  if(abs(x-a) > abs(x-b))cout << 'B' << endll;
  else cout << 'A' << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:41: error: 'endll' was not declared in this scope
   40 |   if(abs(x-a) > abs(x-b))cout << 'B' << endll;
      |                                         ^~~~~
Language: C++

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

int main(){
  int x,a,b,c,d;
  cin >> x >> a >> b;
  c=abs(x-a);
  d=abs(x-b);
  if(c<d){
    cout << "A" << endl;
  }
  else{
    cout << "B" << endl;
  }
}
  

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iinclude; did you mean #include?
    1 | #iinclude <bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> x >> a >> b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iinclude <bits/stdc++.h>
a.cc:7:5: error: 'abs' was not declared in this scope
    7 |   c=abs(x-a);
      |     ^~~
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << "A" << endl;
      |     ^~~~
a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |     cout << "A" << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iinclude <bits/stdc++.h>
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << "B" << endl;
      |     ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:20: error: 'endl' was not declared in this scope
   13 |     cout << "B" << endl;
      |                    ^~~~
a.cc:13:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;

int main() {
    int x, a, b; cin >> x >> a >> b;
    if (abs(x - a) < abs(x - b)) {
        cout << "A" << endl;
    } else [
        cout << "B" << endl;
    ]

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: warning: capture of variable 'std::cout' with non-automatic storage duration
   15 |         cout << "B" << endl;
      |         ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::ostream std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:13: error: expected ',' before '<<' token
   15 |         cout << "B" << endl;
      |             ^~~
      |             ,
a.cc:15:14: error: expected identifier before '<<' token
   15 |         cout << "B" << endl;
      |              ^~
a.cc:15:28: error: expected ']' before ';' token
   15 |         cout << "B" << endl;
      |                            ^
      |                            ]
a.cc: In lambda function:
a.cc:15:28: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:16:5: error: expected primary-expression before ']' token
   16 |     ]
      |     ^
Language: C++

int main() {
	int N;
  	cin >> N;
  	vi A(N);
  	rep(i,N) cin >> A[i];
  	sort(A);
  	riverse(A);
  	ll frag1=0;
  	ll frag2=0;
  	int frag = 1;
  	rep(i,N-1){
    	if(A[i] == A[i+1] && frag == 1){
        	frag1 = A[i];
          	frag = 2;
          	continue;
        }
      	else if(A[i] == A[i+1] && frag == 2){
        	frag2 = A[i];
          	break;
        }
    }
  	ll ans = frag1*frag2;
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:4:9: error: 'vi' was not declared in this scope
    4 |         vi A(N);
      |         ^~
a.cc:5:13: error: 'i' was not declared in this scope
    5 |         rep(i,N) cin >> A[i];
      |             ^
a.cc:5:9: error: 'rep' was not declared in this scope
    5 |         rep(i,N) cin >> A[i];
      |         ^~~
a.cc:6:14: error: 'A' was not declared in this scope
    6 |         sort(A);
      |              ^
a.cc:6:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    6 |         sort(A);
      |         ^~~~
      |         short
a.cc:7:9: error: 'riverse' was not declared in this scope
    7 |         riverse(A);
      |         ^~~~~~~
a.cc:8:9: error: 'll' was not declared in this scope
    8 |         ll frag1=0;
      |         ^~
a.cc:9:11: error: expected ';' before 'frag2'
    9 |         ll frag2=0;
      |           ^~~~~~
      |           ;
a.cc:22:11: error: expected ';' before 'ans'
   22 |         ll ans = frag1*frag2;
      |           ^~~~
      |           ;
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << ans << endl;
      |         ^~~~
a.cc:23:17: error: 'ans' was not declared in this scope
   23 |         cout << ans << endl;
      |                 ^~~
a.cc:23:24: error: 'endl' was not declared in this scope
   23 |         cout << ans << endl;
      |                        ^~~~
Language: Java

import java.util.*;

public class Main{
      public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int x = sc.nextInt();
            int a = sc.nextInt();
            int b = sc.nextInt();
            int x += 1000;
            if(x - a > x - b){
              System.out.println("A");
            } else {
              System.out.println("B");
            }
          }
}

Compiler output:
Main.java:9: error: ';' expected
            int x += 1000;
                 ^
1 error
Language: C++

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

int main(){
  int x,a,b;
  cin>>x>>a>>b;
  if(|x-a|>|x-b|){
    cout<<"B"<<endl;
  }
  else{
    cout<<"A"<<endl;
  }
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected primary-expression before '|' token
    7 |   if(|x-a|>|x-b|){
      |      ^
a.cc:7:11: error: expected primary-expression before '>' token
    7 |   if(|x-a|>|x-b|){
      |           ^
a.cc:7:12: error: expected primary-expression before '|' token
    7 |   if(|x-a|>|x-b|){
      |            ^
a.cc:7:17: error: expected primary-expression before ')' token
    7 |   if(|x-a|>|x-b|){
      |                 ^
Language: C++


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

int main() {
    int x,a,b;
    cin >> x >> a >> b;
    if(a > b && x > a ){
      cout << 'A' << endl;
    }
    else if(a < b && x < a) {
      cout << 'A' << endl;
    }
    else if(a > b && x < a){
      cout << 'B' endl;
    }
    else{
      cout <<'B'<< endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before 'endl'
   15 |       cout << 'B' endl;
      |                  ^~~~~
      |                  ;
Language: Java

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(Math.abs(x-a)<Math.abs(x-b)){
            System.out.println("A")
        }else{
            System.out.println("B");
        }
    }

}


Compiler output:
Main.java:9: error: ';' expected
            System.out.println("A")
                                   ^
1 error
Language: C

#include<stdio.h>
int main(void){
  int x,a,b;
  scanf("%d %d %d",&x,&a,&b);
  int da,db;
  if(x>=a){
    da=x-a;
  }else(x<=a){
    da=a-x;
  }
  if(x>=b){
    db=x-b;
  }else if(x<=b){
    db=b-x;
  }
  if(da<db){
    printf("A");
  }else{
    printf("B");
  }
  putchar('\n');
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected ';' before '{' token
    8 |   }else(x<=a){
      |              ^
      |              ;
Language: C

#include<stdio.h>
int main(void){
  int x,a,b;
  scanf("%d %d %d",&x,&a,&b);
  int da,db;
  if(x>=a){
    da=x-a;
  }else(x<=a){
    da=a-x;
  }
  if(x>=b){
    db=x-b;
  }else(x<=b){
    db=b-x;
  }
  if(da<db){
    printf("A");
  }else{
    printf("B");
  }
  putchar('\n');
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected ';' before '{' token
    8 |   }else(x<=a){
      |              ^
      |              ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int x,a,b;
  cin >> x >> a >> b;
  if(abs(x-a)<abs(x-b)){
    cout << 'A' << nedl;
  }else{
    cout << 'B' << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'nedl' was not declared in this scope
    9 |     cout << 'A' << nedl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>

#define PI 3.141592653589793238
#define INF 1050000000

using namespace std;



//cout << fixed << setprecision(15) << << endl;
//cout << << endl;

int main() {

	int x,a,b;

	cin >> x>>a>>b;
  
    if(abs(x-a)>abs(x-b)){
      cout<<'B'<<endl;
    }else{
      cout << 'A'<<endl;
    }

	cout << ans << endl;

	return 0;
}


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

#include <iostream>
#include <string>

using namespace std;

int main(){
	string S;
	cin >> S;

	/*
	char swap;
	int length = (int)S.size();
	for(int i = 0; i < length; i++){
		for(int j = i + 1; j < length; j++){
			if(S.at(i) > S.at(j)){
				swap = S.at(i);
				S.at(i) = S.at(j);
				S.at(j) = swap;
			}
		}
	}

	char min = 0;
	char pre, cre;
	for(int i = 1; i < length; i++){
		pre = S.at(i-1);
		cre = S.at(i);
		char dist = cre - pre;
		if(dist >= 2){
			min = pre + 1;
			cout << min << endl;
			break;
		}else{
			if(i == length - 1){
				cout << "None" << endl;
				break;
			}
		}
	}
	*/

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected '}' at end of input
    8 |         cin >> S;
      |                  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

int main(){
  int x,A,B;
  cin>>x>>A>>B;
  if(|x-A|>|x-B|){
    cout<<"B"<<endl;
  }
  else{
    cout<<"A"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected primary-expression before '|' token
    7 |   if(|x-A|>|x-B|){
      |      ^
a.cc:7:11: error: expected primary-expression before '>' token
    7 |   if(|x-A|>|x-B|){
      |           ^
a.cc:7:12: error: expected primary-expression before '|' token
    7 |   if(|x-A|>|x-B|){
      |            ^
a.cc:7:17: error: expected primary-expression before ')' token
    7 |   if(|x-A|>|x-B|){
      |                 ^
Language: C

#include<stdio.h>
int main(void){
    int x,a,b;
    scanf("%d%d%d",&x,&a,&b);
    a-=x;b-=x;
    if(a<0)
    a*=-1;
    else
    if(b<0)
    b*=-1;
    if(a<b)
    printf("A");
    else
    {
        printf("B");
    }
    
    

Compiler output:
main.c: In function 'main':
main.c:16:5: error: expected declaration or statement at end of input
   16 |     }
      |     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  char i;
  char[100000] s;
  int k=0;
  
  cin >> s;
  for(i='a';i<='z';i++){
    if(i==s[k]){
      cout << i;
      k++;
      break;}
    else{
    s++;}
  }
  
  if(k==0){
    cout <<"None";
  }
  return 0;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected identifier before numeric constant
    5 |   char[100000] s;
      |        ^~~~~~
a.cc:5:8: error: expected ']' before numeric constant
    5 |   char[100000] s;
      |        ^~~~~~
      |        ]
a.cc:5:7: error: structured binding declaration cannot have type 'char'
    5 |   char[100000] s;
      |       ^
a.cc:5:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:7: error: empty structured binding declaration
a.cc:5:16: error: expected initializer before 's'
    5 |   char[100000] s;
      |                ^
a.cc:8:10: error: 's' was not declared in this scope
    8 |   cin >> s;
      |          ^
Language: C++

#include<iostream>
using namespace std;
#include<algorthm>
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int n=abs(a-b);
  int m=abs(a-c);
  if(n>m)cout<<"B"<<endl;
  else cout<<"A"<<endl;
  return 0;
}

Compiler output:
a.cc:3:9: fatal error: algorthm: No such file or directory
    3 | #include<algorthm>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <math.h>
main(x,a,b){
   scanf("%d%d%d",&x,&a,&b);
   printf(MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(x,a,b){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:3:4: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |    scanf("%d%d%d",&x,&a,&b);
      |    ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <math.h>
  +++ |+#include <stdio.h>
    2 | main(x,a,b){
main.c:3:4: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |    scanf("%d%d%d",&x,&a,&b);
      |    ^~~~~
main.c:3:4: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    4 |    printf(MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
      |    ^~~~~~
main.c:4:4: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:4: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:11: error: implicit declaration of function 'MIN' [-Wimplicit-function-declaration]
    4 |    printf(MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
      |           ^~~
main.c:4:15: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    4 |    printf(MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
      |               ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include <math.h>
  +++ |+#include <stdlib.h>
    2 | main(x,a,b){
Language: C

#include <math.h>
main(x,a,b){
   scanf("%d%d%d",&x,&a,&b);
   printf("%d",MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(x,a,b){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:3:4: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |    scanf("%d%d%d",&x,&a,&b);
      |    ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <math.h>
  +++ |+#include <stdio.h>
    2 | main(x,a,b){
main.c:3:4: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |    scanf("%d%d%d",&x,&a,&b);
      |    ^~~~~
main.c:3:4: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    4 |    printf("%d",MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
      |    ^~~~~~
main.c:4:4: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:4: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:16: error: implicit declaration of function 'MIN' [-Wimplicit-function-declaration]
    4 |    printf("%d",MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
      |                ^~~
main.c:4:20: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    4 |    printf("%d",MIN(abs(a-x),abs(b-x))==abs(a-x)?"A":"B");
      |                    ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include <math.h>
  +++ |+#include <stdlib.h>
    2 | main(x,a,b){
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define fori(i, m, n) for(int i = m; i < (int)n; i++)
#define forl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define all(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string btos(bool ans){
  return (ans?"B":"A");
}
int main() {
  int x,a,b;cin>>x>>a>>b;
  bool ans=abs(x-a)>abs(x-b);
  cout<<bots(ans)<<endl;
  return 0;
}


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

#include <stdio.h>
int main(void){
	int x,a,b,s,t;
	scanf("%d%d%d",&x,&a,&b);
	x>a ? s=(x-a) : s=(a-x);
	x>b ? t=(x-b) : t=(b-x);
	s<t ? printf("A") : printf("B");
}

Compiler output:
main.c: In function 'main':
main.c:5:26: error: lvalue required as left operand of assignment
    5 |         x>a ? s=(x-a) : s=(a-x);
      |                          ^
main.c:6:26: error: lvalue required as left operand of assignment
    6 |         x>b ? t=(x-b) : t=(b-x);
      |                          ^
Language: C

#include <stdio.h>
int main(void){
	int x,a,b,s,t;
	scanf("%d%d%d",&x,&a,&b);
	x>a ? s=x-a : s=a-x;
	x>b ? t=x-b : t=b-x;
	s<t ? printf("A") : printf("B");
}

Compiler output:
main.c: In function 'main':
main.c:5:24: error: lvalue required as left operand of assignment
    5 |         x>a ? s=x-a : s=a-x;
      |                        ^
main.c:6:24: error: lvalue required as left operand of assignment
    6 |         x>b ? t=x-b : t=b-x;
      |                        ^
Language: C

#include <stdio.h>
int main(void){
	char x,a,b,s,t;
	scanf("%d%d%d",&x,&a,&b);
	x>a ? s=x-a : s=a-x;
	x>b ? t=x-b : t=b-x;
	s<t ? printf("A") : printf("B");
}

Compiler output:
main.c: In function 'main':
main.c:5:24: error: lvalue required as left operand of assignment
    5 |         x>a ? s=x-a : s=a-x;
      |                        ^
main.c:6:24: error: lvalue required as left operand of assignment
    6 |         x>b ? t=x-b : t=b-x;
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int sb(int n){
    if(n<0)n+=2*n;
    retrun n;
}
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int A=a-b,B=a-c;
    if(sb(A)>=sb(B))cout<<"A";
    else cout<<"B";
}
    

Compiler output:
a.cc: In function 'int sb(int)':
a.cc:5:5: error: 'retrun' was not declared in this scope
    5 |     retrun n;
      |     ^~~~~~
a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type]
    6 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int sb(int n){
    if(n<0)n+=2*n;
    retrun n;
}
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int A=a-b,B=a-c;
    if(sb(A)>=sb(B))cout<<"A";
    else cout<<"B";
    return 0;
}
    

Compiler output:
a.cc: In function 'int sb(int)':
a.cc:5:5: error: 'retrun' was not declared in this scope
    5 |     retrun n;
      |     ^~~~~~
a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type]
    6 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fr first
#define sc second
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
const int N=3e5+10;
int main()
{
    FASTINOUT;
    int x,a,b;
    cin>>x>>a>>b;
    int A=abs(a-x);
    int b=abs(b-x);
    if (A<=b)
    cout<<"A";
    else
        cout<<"B";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: redeclaration of 'int b'
   17 |     int b=abs(b-x);
      |         ^
a.cc:14:13: note: 'int b' previously declared here
   14 |     int x,a,b;
      |             ^
Language: C++

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

int main() {
 int x , a , b ;
 cin >> x >> a >> b ;
 int a = max(x,a) - min(x,a);
 int b = max(x,b) - min(x,b);
  if(a>b)
    cout << "A" ;
  else 
    cout << "B" ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: redeclaration of 'int a'
    7 |  int a = max(x,a) - min(x,a);
      |      ^
a.cc:5:10: note: 'int a' previously declared here
    5 |  int x , a , b ;
      |          ^
a.cc:8:6: error: redeclaration of 'int b'
    8 |  int b = max(x,b) - min(x,b);
      |      ^
a.cc:5:14: note: 'int b' previously declared here
    5 |  int x , a , b ;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;

int main() {
    int x, a, b; cin >> x >> a >>
    if(abs(x-a)<abs(x-b)) cout << 'A' << endl;
    else cout << 'B' << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected primary-expression before 'if'
    8 |     if(abs(x-a)<abs(x-b)) cout << 'A' << endl;
      |     ^~
a.cc:9:5: error: 'else' without a previous 'if'
    9 |     else cout << 'B' << endl;
      |     ^~~~
Language: C++

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

int main () {
  int X,A,B;
  cin>>X>>A>>B;
  int da = abs(x - a), db = abs(x - b);
  if(da<=db){
    cout<<'A'<<endl;
  }
  else{
    cout<<'B'<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'x' was not declared in this scope
    7 |   int da = abs(x - a), db = abs(x - b);
      |                ^
a.cc:7:20: error: 'a' was not declared in this scope
    7 |   int da = abs(x - a), db = abs(x - b);
      |                    ^
a.cc:8:10: error: 'db' was not declared in this scope; did you mean 'da'?
    8 |   if(da<=db){
      |          ^~
      |          da
Language: C++

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

int abs(int x, int y){
  if(x>=y){
    return x-y;
  }else{
    return y-x;
  }
}

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if(abs(a, b)>abs(a, c)){
    cout << B << endl;
  }else{ 
   cout << A << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'B' was not declared in this scope
   16 |     cout << B << endl;
      |             ^
a.cc:18:12: error: 'A' was not declared in this scope
   18 |    cout << A << endl;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int x,a,b;
  cin >> x >> a >> b;
  abs(a - x) > abs(b - x) ? cout  << "A" << endl; : cout << "B" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:49: error: expected ':' before ';' token
    6 |   abs(a - x) > abs(b - x) ? cout  << "A" << endl; : cout << "B" << endl;
      |                                                 ^
      |                                                 :
a.cc:6:49: error: expected primary-expression before ';' token
a.cc:6:51: error: expected primary-expression before ':' token
    6 |   abs(a - x) > abs(b - x) ? cout  << "A" << endl; : cout << "B" << endl;
      |                                                   ^
Language: C++

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

int main()
{
    int x, a, b;
    cin >> x >> a >> b;

    //int ans = max({x - a,a - x,x - b,b - x}); 
	if(x-a > x-b || a-x > b-x){
    	puts("B");
    }else{
		puts("A)
    }
}


Compiler output:
a.cc:13:22: warning: missing terminating " character
   13 |                 puts("A)
      |                      ^
a.cc:13:22: error: missing terminating " character
   13 |                 puts("A)
      |                      ^~~
a.cc: In function 'int main()':
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int x, a, b;
    cin>>x>>a>>b;
    if(( x<a && a<b ) || x-a < b-x){
        cout<<"A"<<endl;
    }
    elseif(( a<b && b<x ) || b-x < x-a){
        cout<<"B"<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'elseif' was not declared in this scope
   10 |     elseif(( a<b && b<x ) || b-x < x-a){
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repa(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define ALL(a) (a).begin(), (a).end()
#define COUT(x) cout << (x) << endl
#define VIEW(x) do{cout << "--" << #x << "--" << endl; view(x);}while(0)
template<typename T> void view(T e){COUT(e)}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
#define _GLIBCXX_DEBUG

int main(){
  
  int x, a, b;
  cin >> x >> a >> b;
  if ((abs(x-a) < abs(x-b)))
    cout << 'A' << endl;
  else
    cout << 'B' << endl;

}

Compiler output:
a.cc: In function 'void view(T)':
a.cc:9:44: error: expected ';' before '}' token
    9 | template<typename T> void view(T e){COUT(e)}
      |                                            ^
Language: C++

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


int main()
{
 	int x,a,b;
    cin>>x>>a>>b;
    
  	int one=x-a;
  	int two=x-b;
  
  	if(abs(one)>abs(two)) cout<<"B"<<endl;
  	else cout<<"A"<<endl;
  
  
  
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>x>>a>>b;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude<bits/stdc++.h>
a.cc:13:12: error: 'abs' was not declared in this scope
   13 |         if(abs(one)>abs(two)) cout<<"B"<<endl;
      |            ^~~
a.cc:13:31: error: 'cout' was not declared in this scope
   13 |         if(abs(one)>abs(two)) cout<<"B"<<endl;
      |                               ^~~~
a.cc:13:31: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:42: error: 'endl' was not declared in this scope
   13 |         if(abs(one)>abs(two)) cout<<"B"<<endl;
      |                                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iclude<bits/stdc++.h>
a.cc:14:14: error: 'cout' was not declared in this scope
   14 |         else cout<<"A"<<endl;
      |              ^~~~
a.cc:14:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:25: error: 'endl' was not declared in this scope
   14 |         else cout<<"A"<<endl;
      |                         ^~~~
a.cc:14:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

import java.util.*;

public class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		ax = Math.abs(a-x);
		bx = Math.abs(b-x);
		
		if(ax<bx){
			System.out.println(ax);
		} else{
			System.out.println(bx);
		}
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
		ax = Math.abs(a-x);
		^
  symbol:   variable ax
  location: class Main
Main.java:12: error: cannot find symbol
		bx = Math.abs(b-x);
		^
  symbol:   variable bx
  location: class Main
Main.java:14: error: cannot find symbol
		if(ax<bx){
		   ^
  symbol:   variable ax
  location: class Main
Main.java:14: error: cannot find symbol
		if(ax<bx){
		      ^
  symbol:   variable bx
  location: class Main
Main.java:15: error: cannot find symbol
			System.out.println(ax);
			                   ^
  symbol:   variable ax
  location: class Main
Main.java:17: error: cannot find symbol
			System.out.println(bx);
			                   ^
  symbol:   variable bx
  location: class Main
6 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
#define FOR(i, m, n) for(ll (i) = (m); (i) < (n); (i)++)
#define FORN(i, m, n) for(ll (i) = (m); (i) <= (n); (i)++)
#define FORR(i, m, n) for(ll (i) = (m); (i) >= (n); (i)--)
#define rep(i, n) FOR(i, 0, n)
#define repn(i, n) FORN(i, 1, n)
#define repr(i, n) FORR(i, n, 0)
#define repnr(i, n) FORR(i, n, 1)
#define co(n) cout << (n) << endl
#define cosp(n) cout << (n) << ' '
#define setp(n) cout << fixed << setprecision(n);
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const double PI = acos(-1);
const double EPS = 1e-9;

int main(void){
	ll x, a, b;
	cin >> x >> a >> b;
	if(abs(x-a) < abs(x-b)) puts("A");
	else puts("B")

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:23: error: expected ';' before 'return'
   34 |         else puts("B")
      |                       ^
      |                       ;
   35 | 
   36 |         return 0;
      |         ~~~~~~
Language: C++

#include"bits/stdc++.h"
#include<cassert>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const int mod = 1000000007;
const int inf = 1ll << 61;
typedef pair<int, int> P;
typedef pair<int, P>PP;

signed main(){
	int x,a,b;cin>>x>>a>>b;if(abs(x-a)>abs(x-b))puts("B")else puts("A");
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:62: error: expected ';' before 'else'
   12 |         int x,a,b;cin>>x>>a>>b;if(abs(x-a)>abs(x-b))puts("B")else puts("A");
      |                                                              ^~~~
      |                                                              ;
Language: C++

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

int main() {
  int x,a,b,c,d;
  cin >> a >> b;
  c = (a - x)*(a - x);
  d = (b - x)*(b - x);
  if(c > d){
    cout << A << endl;
  }else{
  cout << B << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'A' was not declared in this scope
   10 |     cout << A << endl;
      |             ^
a.cc:12:11: error: 'B' was not declared in this scope
   12 |   cout << B << endl;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main(){
  int x, a, b;
  cin >> x >> a >> b;
  if(pow(x,a)<pow(x,b))cout<<'A'<<endl;}
    else{cout<<'B'<<endl;}
 
  return 0;
}

Compiler output:
a.cc:9:5: error: expected unqualified-id before 'else'
    9 |     else{cout<<'B'<<endl;}
      |     ^~~~
a.cc:11:3: error: expected unqualified-id before 'return'
   11 |   return 0;
      |   ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int x,a,b,y,z;
  cin>>x>>a>>b;
  y = abs(a-x);
  z = abs(b-x);
  if(y>z){
    cout<<z<<endl;
  }
  else{
    cout<<y<<endl;
  }
  return 0;
}
  
#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int x,a,b,y,z;
  cin>>x>>a>>b;
  y = abs(a-x);
  z = abs(b-x);
  if(y>z){
    cout<<"B"<<endl;
  }
  else{
    cout<<"A"<<endl;
  }
  return 0;
}
  


Compiler output:
a.cc:21:5: error: redefinition of 'int main()'
   21 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#define _USE_MATH_DEFINES
#include <math.h>
# include <math.h>
#include <conio.h>
#include <stdio.h>
using namespace std;

int main()
{
    int a,b,c,d,f,q,w;
    cin >> a >> b >> c;
    d=a-c;
    w=fabs(d);
    f=a-b;
    q=fabs(f);
    if(q<w){
        cout << "A";}
    else


    cout << "B";
    return 0;
}


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

#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
  int a,b,c; cin>>a>>b>>c; \\x,a,b
  int d=a-x;
  if(d<0) d=d*(-1);
  int e=b-x;
  if(e<0) e=e*(-1);
  
  if(d<e) cout<<b;
  else cout<<c;
  
 
  
  return 0;
}


Compiler output:
a.cc:8:28: error: stray '\' in program
    8 |   int a,b,c; cin>>a>>b>>c; \\x,a,b
      |                            ^
a.cc:8:29: error: stray '\' in program
    8 |   int a,b,c; cin>>a>>b>>c; \\x,a,b
      |                             ^
a.cc: In function 'int main()':
a.cc:8:30: error: 'x' was not declared in this scope
    8 |   int a,b,c; cin>>a>>b>>c; \\x,a,b
      |                              ^
a.cc:10:6: error: 'd' was not declared in this scope
   10 |   if(d<0) d=d*(-1);
      |      ^
a.cc:14:6: error: 'd' was not declared in this scope
   14 |   if(d<e) cout<<b;
      |      ^
Language: C++

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

int main (){
int x,a,b,xa,xb;
cin >> x >> a >> b;
xa = abs(x-a);
xb = abs(x-b);
if(xa >= xb)cout << "A" << endl;
else cout << "B" << endl;

}
    


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

#include<iostream>
#define size(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  if(abs(a - b) > abs(a - c)){
    cout << "C"
  }else{
    cout << "B"
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before '}' token
    8 |     cout << "C"
      |                ^
      |                ;
    9 |   }else{
      |   ~             
a.cc:10:16: error: expected ';' before '}' token
   10 |     cout << "B"
      |                ^
      |                ;
   11 |   }
      |   ~
Language: C++

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

int main() {
 int A; int B; int C;
  cin>>A>>B>>C;
  if(abs(A-B)>abs(A-C)
     cout<<B<<endl;
     else cout<<A<<endl;
     }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: expected ';' before 'cout'
    8 |   if(abs(A-B)>abs(A-C)
      |                       ^
      |                       ;
    9 |      cout<<B<<endl;
      |      ~~~~              
a.cc:10:6: error: expected primary-expression before 'else'
   10 |      else cout<<A<<endl;
      |      ^~~~
a.cc:9:20: error: expected ')' before 'else'
    9 |      cout<<B<<endl;
      |                    ^
      |                    )
   10 |      else cout<<A<<endl;
      |      ~~~~           
a.cc:8:5: note: to match this '('
    8 |   if(abs(A-B)>abs(A-C)
      |     ^
Language: C++

if a < x:
    a_abs = x-a
else:
    a_abs = a-x

if b < x:
    b_abs = x-b
else:
    b_abs = b-x
if a_abs > b_abs:
    print("B")
else:
    print("A")

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'if'
    1 | if a < x:
      | ^~