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

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

int main 
{
    int n;

    cin<<n;

    if(n>999)
        cout>>"ABD";

    else
    cout>>"ABC";
}

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main
      |     ^~~~
a.cc:6:5: error: expected primary-expression before 'int'
    6 |     int n;
      |     ^~~
a.cc:6:5: error: expected '}' before 'int'
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
a.cc:8:5: error: 'cin' does not name a type
    8 |     cin<<n;
      |     ^~~
a.cc:10:5: error: expected unqualified-id before 'if'
   10 |     if(n>999)
      |     ^~
a.cc:13:5: error: expected unqualified-id before 'else'
   13 |     else
      |     ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: Java

public void solution(int m) {
		if(m>0&&m<1000) {
			System.out.println("ABC");
		}else if(m>=1000&&m<2000) {
			System.out.println("ABD");
		}
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public void solution(int m) {
       ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
//int 整数 double 小数（実数） string 文字列 bool 0以外真 if else char ''
// != 等しくない true 1 真  false 0 偽
// ! 偽 && かつ || または 文字列変数.size() 文字数 文字列.at(i)　i文字目

int main() {
    
    int >> N;
  cin >> N;
  if(N <= 999){
      cout << "ABC" << endl;
  }
  else{
      cout << "ABD" << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected unqualified-id before '>>' token
    9 |     int >> N;
      |         ^~
a.cc:10:10: error: 'N' was not declared in this scope
   10 |   cin >> N;
      |          ^
a.cc:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <stdio.h>
using namespace std;

int main 
{
    int n;

    cin<<n;

    if(n>999)
        cout>>"ABD";

    else
    cout>>"ABC";
}

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main
      |     ^~~~
a.cc:6:5: error: expected primary-expression before 'int'
    6 |     int n;
      |     ^~~
a.cc:6:5: error: expected '}' before 'int'
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
a.cc:8:5: error: 'cin' does not name a type
    8 |     cin<<n;
      |     ^~~
a.cc:10:5: error: expected unqualified-id before 'if'
   10 |     if(n>999)
      |     ^~
a.cc:13:5: error: expected unqualified-id before 'else'
   13 |     else
      |     ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

#include<cstdio>
int main() {
	int n;
	cin >> n;
	if (n <= 999) printf("ABC");
	else printf("ABD");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n;
      |         ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin>>N;
  if(N<=999) {cout<<“ABC”<<endl;}
  else{cout<<“ABD”<<endl;}
  return 0;
}


Compiler output:
a.cc:7:21: error: extended character “ is not valid in an identifier
    7 |   if(N<=999) {cout<<“ABC”<<endl;}
      |                     ^
a.cc:7:21: error: extended character ” is not valid in an identifier
a.cc:8:14: error: extended character “ is not valid in an identifier
    8 |   else{cout<<“ABD”<<endl;}
      |              ^
a.cc:8:14: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:21: error: '\U0000201cABC\U0000201d' was not declared in this scope
    7 |   if(N<=999) {cout<<“ABC”<<endl;}
      |                     ^~~~~
a.cc:8:14: error: '\U0000201cABD\U0000201d' was not declared in this scope
    8 |   else{cout<<“ABD”<<endl;}
      |              ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  if(n<1000)cout<<"ABC"endl;
  else cout<<"ABD"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: unable to find string literal operator 'operator""endl' with 'const char [4]', 'long unsigned int' arguments
    6 |   if(n<1000)cout<<"ABC"endl;
      |                   ^~~~~~~~~
Language: C++

#include <stdio.h>
int main() {
	int a;
	scanf_s("%d", &a);
	if (a >= 1000)
		printf("ABD%03d", a - 1000);
	else
		printf("ABC%03d\n", a);
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    4 |         scanf_s("%d", &a);
      |         ^~~~~~~
      |         scanf
Language: Java

import java.util.Scanner;

public class ABD {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 1000)System.out.println("ABC");
		else System.out.println("ABD");
	}

}


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

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        if(n > 1000){
            System.out.println(ABD);

        }else{
            System.out.println(ABC);
        }
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
            System.out.println(ABD);
                               ^
  symbol:   variable ABD
  location: class Main
Main.java:12: error: cannot find symbol
            System.out.println(ABC);
                               ^
  symbol:   variable ABC
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
  int N;
  cin >> N;
  if(N<1000) {
    else cout << "ABC" << endl;
  }
  else {
    else cout << "ABD" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: expected '}' before 'else'
   24 |     else cout << "ABC" << endl;
      |     ^~~~
a.cc:23:14: note: to match this '{'
   23 |   if(N<1000) {
      |              ^
a.cc: At global scope:
a.cc:26:3: error: expected unqualified-id before 'else'
   26 |   else {
      |   ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a
  cin>>a;
	if(a<1000)cout<<"ABC";
  else cout<<"ABD";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin>>a;
      |   ^~~
a.cc:7:12: error: 'a' was not declared in this scope
    7 |         if(a<1000)cout<<"ABC";
      |            ^
Language: C++

#include <stdio.h>

int main (){
int num;
scanf("%d", &num);
if(num<1000) {printf("ABC¥n");}
else {print("ABD¥n");}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'print' was not declared in this scope; did you mean 'printf'?
    7 | else {print("ABD¥n");}
      |       ^~~~~
      |       printf
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Integer a = sc.nextInt();
		Integer b = sc.nextInt();

		if(N<1000) {
			System.out.println("ABC");
		} else {
			System.out.println("ABD");
		}

	}

}



Compiler output:
Main.java:8: error: cannot find symbol
		if(N<1000) {
		   ^
  symbol:   variable N
  location: class Main
1 error
Language: C++

#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <cmath>


using namespace std;

int main()
{
	int A;

	cin >> A;

	if (A < 1000)
		cout << "ABC" << endl;
	else
		cout << "ABD" << endl;

	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main()
{
while(cin>>x)
{
if(x<1000)
cout<<"ABC"<<endl;
else
cout<<"ABD"<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'x' was not declared in this scope
    6 | while(cin>>x)
      |            ^
Language: Java

import java.util.Scanner;

class Main {
  Scanner in = new Scanner(System.in);
  int n = in.nextInt();
  if (n < 1000){
    System.out.print("ABC");
  }else{
     System.out.print("ABD");

  }
}

Compiler output:
Main.java:6: error: illegal start of type
  if (n < 1000){
  ^
Main.java:6: error: illegal start of type
  if (n < 1000){
          ^
Main.java:8: error: illegal start of type
  }else{
   ^
3 errors
Language: C++

#include<bits/stdc++.h>
  using namespace std;
int n;
inline void into(){
  scnaf("%d",&n);
}
inline void work(){
}
inline void outo(){
  if (n<=999) printf("ABC\n");
  else printf("ABD\n");
}
int main(){
  into();
  work();
  outo();
  return 0;
}

Compiler output:
a.cc: In function 'void into()':
a.cc:5:3: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
    5 |   scnaf("%d",&n);
      |   ^~~~~
      |   scanf
Language: C++

#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <cmath>


using namespace std;

int main()
{
	int A, B, C;

	cin >> A;	cin >> B;	cin >> C;

	if (A < 1000)
		cout << "ABC" << endl;
	else
		cout << "ABD" << endl;

	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int N;
int main (){
    cin >> N;
    if( N < 1000) cout << "ABC" << endl;
    else cout << "ABD" << endl;
    return 0;
}
~  

Compiler output:
a.cc:12:2: error: expected class-name at end of input
   12 | ~
      |  ^
Language: C++

v#include "bits/stdc++.h"
using namespace std;
#define ri(a,b,c) for(int a=(b);a<(c);++a)
#define ll long long
#define rll(a,b,c) for(ll a=(b);a<(c);++a)

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

    int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
cin>>a;
  cout<<(a/1000?"ABD":"ABC")<<endl;

















    return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include "bits/stdc++.h"
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include "bits/stdc++.h"
      | ^
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin.tie(0);
      |     ^~~
a.cc:9:5: error: 'ios' has not been declared
    9 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout<<(a/1000?"ABD":"ABC")<<endl;
      |   ^~~~
a.cc:13:31: error: 'endl' was not declared in this scope
   13 |   cout<<(a/1000?"ABD":"ABC")<<endl;
      |                               ^~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
 
#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
 
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
 
#define FOREACH(x,a) for(auto& (x) : (a) )
 
#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])
 
#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl
 
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}
 
#define ALL(obj) (obj).begin(),(obj).end()
 
#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
 
template <class T = ll>
T IN(){T x;cin>>x;return (x);}
 
template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
    VECCIN(head);
    VT2(move(tail)...);
}
 
template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
    seco[head]=IN();
    VT3(head,move(tail)...);
}
 
#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc
 
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision; // cpp_int
 
#define P pair<ll,ll>
#define V vector<ll>
#define M map<ll,ll>
#define S set<ll>
 
#define pb(a) push_back(a)
#define mp make_pair
 
int main(){
    CIN(n);
    SANKOU(n<1000?"ABC":"ABD");
 
    return 0;
}

Compiler output:
a.cc:89:30: error: macro "SANKOU" requires 3 arguments, but only 1 given
   89 |     SANKOU(n<1000?"ABC":"ABD");
      |                              ^
a.cc:15:9: note: macro "SANKOU" defined here
   15 | #define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:89:5: error: 'SANKOU' was not declared in this scope
   89 |     SANKOU(n<1000?"ABC":"ABD");
      |     ^~~~~~
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		if (n<1000) {
			System.out.println("ABC");
		}else {
			System.out.println("ABD");
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        if (N <= 999) {
            System.out.println("ABC");
        } else {
            System.out.println("ABD");
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Integer N = sc.nextInt();

		if(N<>1000) {
			System.out.println("ABC");
		} else {
			System.out.println("ABD");
		}

	}

}



Compiler output:
Main.java:7: error: illegal start of expression
		if(N<>1000) {
		     ^
1 error
Language: C++

#include <stdio.h>

int main (){
int num;
scanf("%d", &num);
if(num<1000) printf("ABC¥n");
else print("ABD¥n");

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'print' was not declared in this scope; did you mean 'printf'?
    7 | else print("ABD¥n");
      |      ^~~~~
      |      printf
Language: C

#include<stdio.h>
int main{
	int a;
	scanf("%d",&a);
	if(a<1000)
		printf("ABC\n");
	else
		printf("ABD\n");
	return 0;
}

Compiler output:
main.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | int main{
      |         ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int a;
    cin >> a;
    
    if a <= 999{
        cout << "ABC" << endl;
    }
    else{
        cout << "ABD" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: expected '(' before 'a'
   11 |     if a <= 999{
      |        ^
      |        (
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else{
      |     ^~~~
Language: C++

#include<cstdio>

int main() {
    int n;
    while (~scanf("%d", &n)) {
        print("%s\n", (n < 1000)? "ABC" : "ABD");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'print' was not declared in this scope; did you mean 'printf'?
    6 |         print("%s\n", (n < 1000)? "ABC" : "ABD");
      |         ^~~~~
      |         printf
Language: C++

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

typedef long long ll;

int main()
{
   
   int i;
   cin>>i;
   if(i<=999)cout<<"ABC"<<endl;
   else cout"ABD"<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before string constant
   14 |    else cout"ABD"<<endl;
      |             ^~~~~
      |             ;
Language: C++

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

int main()
{
    int n;
    scanf("%d",&n);
    if(n>=1000) printf("ABD")；
    else printf("ABC");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before '\U0000ff1b'
   10 |     if(n>=1000) printf("ABD")；
      |                              ^~
      |                              ;
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();



        if(n > 1000){
            System.out.println(ABD);
            
        }else{
            System.out.println(ABC);
        }
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
            System.out.println(ABD);
                               ^
  symbol:   variable ABD
  location: class Main
Main.java:14: error: cannot find symbol
            System.out.println(ABC);
                               ^
  symbol:   variable ABC
  location: class Main
2 errors
Language: C++

import java.util.*;

class Main{
	
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();

		if(N<=999)
			System.out.println("ABC");
		else
			System.out.println("ABD");

	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main(String args[]){
      |               ^~~~~~~
      |               :
a.cc:5:33: error: 'String' has not been declared
    5 |         public static void main(String args[]){
      |                                 ^~~~~~
a.cc:17:2: error: expected ';' after class definition
   17 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:7:17: error: 'Scanner' was not declared in this scope
    7 |                 Scanner sc = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:9:25: error: 'sc' was not declared in this scope
    9 |                 int N = sc.nextInt();
      |                         ^~
a.cc:12:25: error: 'System' was not declared in this scope
   12 |                         System.out.println("ABC");
      |                         ^~~~~~
a.cc:14:25: error: 'System' was not declared in this scope
   14 |                         System.out.println("ABD");
      |                         ^~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std ;

int main(){
	scanf( "%d" , &N ) ;
	if( N <= 999 ) puts( "ABC" ) ;
	else puts( "ABD" ) ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: 'N' was not declared in this scope
    7 |         scanf( "%d" , &N ) ;
      |                        ^
Language: C++

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

int main(void){
    int n;
    cin>>n;
    if(n<1000){
        printf("ABC%03d\n",n);
    }else{
        printf("ABD%03d\n",n-999);
    }
    return 0;
}


Compiler output:
a.cc:2:21: error: 'b' does not name a type
    2 | using namespace std;b
      |                     ^
Language: C++

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

typedef long long ll;

int main()
{
   ios::sync_with_stdio(false);
   cin.tie(0);
   
   int i;
   cin>>i;
   if(i<=999)cout<<"ABC"<<endl;
   else cout"ABD"<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: expected ';' before string constant
   16 |    else cout"ABD"<<endl;
      |             ^~~~~
      |             ;
Language: C

#include <stdio.h>

int main(void){
  int N;
  scanf("%d", &N);
  if (N>=1000) printf("ABD\n");
  else printf("ABC"\n);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:20: error: stray '\' in program
    7 |   else printf("ABC"\n);
      |                    ^
main.c:7:20: error: expected ')' before 'n'
    7 |   else printf("ABC"\n);
      |              ~     ^~
      |                    )
Language: C++

#include <bits\stdc++.h>

using namespace std;

int main(){
	int num;
	cin >> num;
	if(num <= 999)
		cout << "ABC" << endl;
	else
		cout << "ABD" << endl;
	return 0;
}

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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		if(N>=1000){
			System.out.println("ABD");
		}else{
			System.out.println("ABC");
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

N=int(input())
if (N<=999):
	print('ABC')
else:
	print('ABD')

Compiler output:
a.cc:3:15: warning: multi-character character constant [-Wmultichar]
    3 |         print('ABC')
      |               ^~~~~
a.cc:5:15: warning: multi-character character constant [-Wmultichar]
    5 |         print('ABD')
      |               ^~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    if (N<1000) {
        cout << "ABC";
    } else if {
        cout << "ABD";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected '(' before '{' token
    8 |     } else if {
      |               ^
      |               (
Language: C++

use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<usize>();
    if n < 1000 {
        println!("ABC");
    } else {
        println!("ABD");
    }
}


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #[
    4 | #[allow(dead_code)]
      |  ^
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::*;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::str::FromStr;
      | ^~~
a.cc:5:1: error: 'fn' does not name a type
    5 | fn read<T: FromStr>() -> T {
      | ^~
a.cc:17:1: error: 'fn' does not name a type
   17 | fn main() {
      | ^~
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(long long i = 0;i < n;++i)
#define FOR(i,a,b) for(long long i = a;i < b;++i)
using namespace std;
using ll = long long;
using point = pair< int,int >;

int main(){
    int n;
    scanf("%d",&n);
    if (n < 1000) cout<<ABC<<endl;
    else cout<<ABD<<endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'ABC' was not declared in this scope
   11 |     if (n < 1000) cout<<ABC<<endl;
      |                         ^~~
a.cc:12:16: error: 'ABD' was not declared in this scope
   12 |     else cout<<ABD<<endl;
      |                ^~~
Language: C++

#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
#define INF (1<<29)
#define test cout << "test" << endl;

int main (){
	int a;
	cin >> a;
	if(a>=1000){
		cout << "ABD" <<endl;
	}
	else {
		cout << "ABC" <<endl
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:37: error: expected ';' before '}' token
   24 |                 cout << "ABC" <<endl
      |                                     ^
      |                                     ;
   25 |         }
      |         ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
    int n;
     cin >> n;
     if(n<1000)  cout < < "ABC" << endl;
     else cout << "ABD" << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:25: error: expected primary-expression before '<' token
   25 |      if(n<1000)  cout < < "ABC" << endl;
      |                         ^
a.cc:25:33: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
   25 |      if(n<1000)  cout < < "ABC" << endl;
      |                           ~~~~~~^~~~~~~
Language: C++

#include"bits\stdc++.h"
using namespace std;


int main() {
	int N;
	cin >> N;

	if (N > 999) cout << "ABD" << endl;
	else cout << "ABC" << endl;
}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include"bits\stdc++.h"
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
if(n>=1000)
printf("ABD");
else
printf("ABC);
return 0;
}

Compiler output:
a.cc:9:8: warning: missing terminating " character
    9 | printf("ABC);
      |        ^
a.cc:9:8: error: missing terminating " character
    9 | printf("ABC);
      |        ^~~~~~
a.cc: In function 'int main()':
a.cc:10:1: error: expected primary-expression before 'return'
   10 | return 0;
      | ^~~~~~
Language: C++


import java.util.Scanner;

/**
 * Created by oka on 2018/06/10.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        if (n < 1000) {
            System.out.println("ABC");
        } else {
            System.out.println("ABD");
        }
    }
}


Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
    7 | public class Main {
      | ^~~~~~
Language: C

#ifdef _WIN32
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif

// 継承可能な型
template <class Type>
struct IN : Type
{
	IN()
	{
		std::cin >> *this;
	}
};

// 継承不可能な型
template <class Type>
struct IN_
{
	Type val;

	IN_()
	{
		std::cin >> val;
	}

	operator Type&()
	{
		return val;
	}

	IN_<Type>& operator=(const Type& _value)
	{
		val = _value;
		return *this;
	}
};

template <class Char, class Type>
std::basic_ostream<Char>& operator <<(std::basic_ostream<Char>& os, const IN_<Type>& value)
{
	return os << value.val;
}

template <class Char, class Type>
std::basic_istream<Char>& operator >>(std::basic_istream<Char>& is, IN_<Type>& value)
{
	return is >> value.val;
}

template <class Type>
void OUT(const Type& value)
{
	std::cout << value << std::endl;
}

template <class Type, class ... Args>
void OUT(const Type& value, const Args& ... args)
{
	std::cout << value << ' ';
	OUT(args...);
}

void Yes()
{
	OUT("Yes");
}
void No()
{
	OUT("No");
}

using ll = long long;
using inll = IN_<ll>;
using vll = std::vector<ll>;
using setll = std::set<ll>;
using msetll = std::multiset<ll>;
using instr = IN<std::string>;

// 階乗を計算 O(N) (N=10^7 で O(10^7))
int Factorial(ll n)
{
	for (ll i = n - 1; i > 1; i--)
		n *= i;
	return n;
}

// nCrを計算 O(N) (N=10^7 で O(10^7))
ll Combination(const ll n, const ll r)
{
	return Factorial(n) / (Factorial(r) * Factorial(n - r));
}

// 素数判定 O(sqrt(N)) (N=10^7 で O(10^3))
bool IsPrime(const ll num)
{
    if (num < 2) return false;
    if (num == 2) return true;
    if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}

// 各桁の和を計算 O(logN) (N=10^7 で O(7))
ll DigitSum(ll n)
{
	ll sum = 0;
	while(n != 0){
		sum += n % 10;
		n /= 10;
	}
	return sum;
}

#define FOR(i, m, n) for (ll (i) = (m); (i) < (n); ++(i))
#define REP(i, n) for (ll (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (ll (i) = (n); (i) >= 0; --(i))
#define ITRREP(it, v) for (auto (it) = (v).begin(); (it) != (v).end(); ++(it))
#define ITRREPR(it, v) for (auto (it) = (v).rbegin(); (it) != (v).rend(); ++(it))
#define DIVUP(a, b) (((a) + (b) - 1) / (b))

void Main();

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

	Main();

#ifdef _DEBUG
	system("pause");
#endif

	return 0;
}

using namespace std;

//////////////////////////////

void Main()
{
	inll n;

	if (n > 999)
	{
	return OUT("ABD", n);
	}else if(n > 99)
	return OUT("ABC", n);
	else
	return OUT("ABC0", n);
}


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

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<P>> Graph;


int main(){
  
  int n;
  cin >> n
    
    if(n <= 999) cout << "ABC" << endl;
  else cout << "ABD" <<  endl;

  

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: expected ';' before 'if'
   17 |   cin >> n
      |           ^
      |           ;
   18 | 
   19 |     if(n <= 999) cout << "ABC" << endl;
      |     ~~     
a.cc:20:3: error: 'else' without a previous 'if'
   20 |   else cout << "ABD" <<  endl;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
const int mod = 1e9+7;
//26

class UnionFind{
public:
	vector<int> ran, par;
	void init(int n){
		for(int i = 0;i < n;i++){
			par.push_back(i);
			ran.push_back(0);
		}
	}
	
	int find(int x){
		if(par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	
	void unite(int x, int y){
		x = find(par[x]);
		y = find(par[y]);
		if(x == y)return;
		if(ran[x] < ran[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(par[x] == par[y])ran[x]++;
		}
	}
	
	bool same(int x, int y){
		return find(par[x]) == find(par[y]);
	}
};

int a[200];
signed main(){
	int n;
	scanf("%lld", &n);
	if(i >= 1000)printf("ABD\n");
	else printf("ABC\n");
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:63:12: error: 'i' was not declared in this scope
   63 |         if(i >= 1000)printf("ABD\n");
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
    int n;
     cin >> n;
     if(n<1000) << cout < < "ABC" << endl;
     else cout << "ABD" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: expected primary-expression before '<<' token
   25 |      if(n<1000) << cout < < "ABC" << endl;
      |                 ^~
a.cc:25:27: error: expected primary-expression before '<' token
   25 |      if(n<1000) << cout < < "ABC" << endl;
      |                           ^
a.cc:25:35: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
   25 |      if(n<1000) << cout < < "ABC" << endl;
      |                             ~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
 
#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
 
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
 
#define FOREACH(x,a) for(auto& (x) : (a) )
 
#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])
 
#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl
 
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}
 
#define ALL(obj) (obj).begin(),(obj).end()
 
#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
 
template <class T = ll>
T IN(){T x;cin>>x;return (x);}
 
template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
    VECCIN(head);
    VT2(move(tail)...);
}
 
template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
    seco[head]=IN();
    VT3(head,move(tail)...);
}
 
#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc
 
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision; // cpp_int
 
#define P pair<ll,ll>
#define V vector<ll>
#define M map<ll,ll>
#define S set<ll>
 
#define pb(a) push_back(a)
#define mp make_pair
 
int main(){
    CIN(n);
    SANKOU(n<1000?"ABC":"ADC");
 
    return 0;
}

Compiler output:
a.cc:89:30: error: macro "SANKOU" requires 3 arguments, but only 1 given
   89 |     SANKOU(n<1000?"ABC":"ADC");
      |                              ^
a.cc:15:9: note: macro "SANKOU" defined here
   15 | #define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:89:5: error: 'SANKOU' was not declared in this scope
   89 |     SANKOU(n<1000?"ABC":"ADC");
      |     ^~~~~~
Language: C++

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)(1e9+7)

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
  int n;
  cin >> n;
  if(n <= 999) cout << "ABC" << endl;
  else cout << "ABD" << endl;
}


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

# include < cstdio >
typedef long long ll ;
int A , B ;
int main ()
{
scanf ("% d % d " ,&A ,& B );
printf ("% d \ n " ,(B - A )*( B - A +1)/2 - B );

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

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

int main(){
  int a, b;
  cin >> a >> b;
  c = b - a;
  c = c * (c + 1) / 2;
  cout << c - b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'c' was not declared in this scope
    7 |   c = b - a;
      |   ^
Language: C++

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

int main(){
  int A,B;
  cin >> A >> B;
  cout << (B-A)(B-A+1)/2-B << endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expression cannot be used as a function
    7 |   cout << (B-A)(B-A+1)/2-B << endl;
      |           ~~~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int func(X){
  
int main(){
  int A,B;
  cin >> A >> B;
  cout << (B-A)(B-A+1)/2-B << endl;
}

Compiler output:
a.cc:3:10: error: 'X' was not declared in this scope
    3 | int func(X){
      |          ^
Language: C++

#include <iostream>
using namespace std;
int main () {
    int a,b,n=0;
    cin >> a >> b;
    for (int i=1;i<b;i++)
    {
        for (int j=1;j<=999;j++)
        {
            n+=j;
            if (n==a+i || n==b+i)
            {
                cout << i << endl;
                return 0;
            }
        }
        n=0;n
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected ';' before '}' token
   17 |         n=0;n
      |              ^
      |              ;
   18 |     }
      |     ~
Language: C++

/*
      author  : nishi5451
      created : 14.08.2020 19:12:59
*/

#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 a,b;
    cin >> a >> b;
    int dif = b-a;
    int hb = dif(dif+1)/2;
    cout << x-hb << endl;    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'dif' cannot be used as a function
   16 |     int hb = dif(dif+1)/2;
      |              ~~~^~~~~~~
a.cc:17:13: error: 'x' was not declared in this scope
   17 |     cout << x-hb << endl;
      |             ^
Language: C++

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

int main() {
  int a,b;
  cin >> a >> b;
  vector <int> h(1000,0)
    for (int i=1 ; i<1000;i++){
      h.at(i) = h.at(i-1)+i ;
    }
  cout << h.at(b-a)-b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'for'
    8 |     for (int i=1 ; i<1000;i++){
      |     ^~~
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for (int i=1 ; i<1000;i++){
      |                    ^
Language: C++

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

int main() {
  int a,b;
  cin >> a >> b;
  vector <int> h(1000,0)
    for (int i=1 ; i<1000;i++){
      h.at(i) = h.at(i-1)+i
    }
  cout << h.at(b-a)-b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'for'
    8 |     for (int i=1 ; i<1000;i++){
      |     ^~~
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for (int i=1 ; i<1000;i++){
      |                    ^
Language: C++

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

int main(){
  int A,B;
  cin >> A >> B;
  cout<<((B-A)*(B-A+1)/2)-b<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: 'b' was not declared in this scope
    7 |   cout<<((B-A)*(B-A+1)/2)-b<<endl;
      |                           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int a,b,k=0;
    cin>>a>>b;
    for(int i=1; ;i++){
        k1=(i*(i+1))/2;
        k2+=((i+1)*(i+1+1))/2;
        if(k1>=a && k2>=b && (k1-a)==(k2-b)) break;
    }
    cout<<k1-a;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'k1' was not declared in this scope; did you mean 'k'?
   10 |         k1=(i*(i+1))/2;
      |         ^~
      |         k
a.cc:11:9: error: 'k2' was not declared in this scope; did you mean 'k'?
   11 |         k2+=((i+1)*(i+1+1))/2;
      |         ^~
      |         k
a.cc:14:11: error: 'k1' was not declared in this scope; did you mean 'k'?
   14 |     cout<<k1-a;
      |           ^~
      |           k
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int total =b-a;
        int tall =0;
        
        for(int i=sum;i>0;i--){
            tall += i;
        }
        System.out.println(tall - b);
    }
} 

Compiler output:
Main.java:11: error: cannot find symbol
        for(int i=sum;i>0;i--){
                  ^
  symbol:   variable sum
  location: class Main
1 error
Language: C++


#include <bits/stdc++.h>
using namespace std;
 
int main() {
    
          int a,b;
  cin>>a>>b;
  cout << (b-a) * (b-a+1) /2 -b <<endl:
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: expected ';' before ':' token
    9 |   cout << (b-a) * (b-a+1) /2 -b <<endl:
      |                                       ^
      |                                       ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int a,b,x=0,y=0;
    cin>>a>>b;
    for(int i=1; i<=1000; i++)
    {
        if(((i*(i+1))/2)>=a)
        {
           x=((i*(i+1))/2)-a;
           break;
        }
    }
    for(int i=1; i<=1000; i++)
    {
        if(((i*(i+1))/2)>=b)
        {
           y=((i*(i+1))/2)-b;
           break;
        }
    }
    cout<<max(x,y,1)<<endl;

    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:36:14:   required from here
   36 |     cout<<max(x,y,1)<<endl;
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a, b;
    scanf("%d%d" &a, &b);
    printf("%d\n", (b - a) * (b - a + 1) / 2 - b);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: invalid operands of types 'const char [5]' and 'int' to binary 'operator&'
    6 |     scanf("%d%d" &a, &b);
      |           ~~~~~~ ^~
      |           |       |
      |           |       int
      |           const char [5]
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a, b;
    scanf("%d%d" & a, &b);
    printf("%d\n", (b - a) * (b - a + 1) / 2 - b);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: invalid operands of types 'const char [5]' and 'int' to binary 'operator&'
    6 |     scanf("%d%d" & a, &b);
      |           ~~~~~~ ^ ~
      |           |        |
      |           |        int
      |           const char [5]
Language: C

/* ex4_3
  terakura */

#include <stdio.h>

int depth(int west_height, int east_height);      //n番目の塔の高さ nは隣同士の塔の高さの差からわかる

int main(void){
    int west_heght, east_heght;
    scanf("%d %d", &west_heght, &east_heght);

    printf("%d\n", depth(west_height, east_height));

    return 0;

}


int depth(int west_height, int east_height){
    int diff, ans, hei ;
    diff = east_height - west_height;
    int i;
    for(i=0; i < diff + 1; i++){
        hei = hei + i;
    }

    ans = hei - east_heigt;

    return ans

}


Compiler output:
main.c: In function 'main':
main.c:12:26: error: 'west_height' undeclared (first use in this function); did you mean 'west_heght'?
   12 |     printf("%d\n", depth(west_height, east_height));
      |                          ^~~~~~~~~~~
      |                          west_heght
main.c:12:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:39: error: 'east_height' undeclared (first use in this function); did you mean 'east_heght'?
   12 |     printf("%d\n", depth(west_height, east_height));
      |                                       ^~~~~~~~~~~
      |                                       east_heght
main.c: In function 'depth':
main.c:27:17: error: 'east_heigt' undeclared (first use in this function); did you mean 'east_height'?
   27 |     ans = hei - east_heigt;
      |                 ^~~~~~~~~~
      |                 east_height
main.c:29:15: error: expected ';' before '}' token
   29 |     return ans
      |               ^
      |               ;
   30 | 
   31 | }
      | ~