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

#inclue<bits/stdc++.h>
using namespace std;
int main()
{
  int n;cin>>n;
  if(n%1000!=0)cout<<1000-n%1000<<endl;
  else cout<<0<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |   int n;cin>>n;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclue<bits/stdc++.h>
a.cc:6:16: error: 'cout' was not declared in this scope
    6 |   if(n%1000!=0)cout<<1000-n%1000<<endl;
      |                ^~~~
a.cc:6:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:35: error: 'endl' was not declared in this scope
    6 |   if(n%1000!=0)cout<<1000-n%1000<<endl;
      |                                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclue<bits/stdc++.h>
a.cc:7:8: error: 'cout' was not declared in this scope
    7 |   else cout<<0<<endl;
      |        ^~~~
a.cc:7:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:17: error: 'endl' was not declared in this scope
    7 |   else cout<<0<<endl;
      |                 ^~~~
a.cc:7:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

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

    for (int i=0; ;i++){
      int tmp = (i+1)*1000 - n;
      if (tmp >0){
        System.out.println(tmp);
        break;
      }
    }
  }
}


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

#include <iostream>
using namespace std;

int main(){
  int N;
  int m= 0;
  int ans, m, x= 0 ;
  cin >> N;
  if(N>1000) m = N/1000+1;
  
  x =1000*m;
  ans = x - N;

  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: redeclaration of 'int m'
    7 |   int ans, m, x= 0 ;
      |            ^
a.cc:6:7: note: 'int m' previously declared here
    6 |   int m= 0;
      |       ^
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    cin >> n;
    cout << n%1000 << "\n";:
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: expected primary-expression before ':' token
   22 |     cout << n%1000 << "\n";:
      |                            ^
Language: C++

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

int main()
{
    int n;
    cin>>n;
    if((1<n)&&(n<=1000))
    cout<<1000-n;
    else{
        if((1001<n)&&(n<=2000))
        cout<<2000-n;
        else{
            if((2001<n)&&(n<=3000))
            cout<<3000-n;
            else{
                if((3001<n)&&(n<=4000))
                cout<<4000-n;
                    else{
                        if((4001<n)&&(n<=5000))
                        cout<<5000-n;
                        else{
                            if((5001<n)&&(n<=6000))2
                            cout<<6000-n;
                            else{
                                if((6001<n)&&(n<=7000))
                                cout<<7000-n;
                                else{
                                    if((7001<n)&&(n<=8000))
                                    cout<<8000-n;
                                    else{
                                        if((8001<n)&&(n<=9000))
                                            cout<<9000-n;
                                        else{
                                            if((9001<n)&&(n<=10000))
                                                cout<<10000-n;
                                        }
                                    }
                                }
                            }
                        }
                    }
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:53: error: expected ';' before 'cout'
   23 |                             if((5001<n)&&(n<=6000))2
      |                                                     ^
      |                                                     ;
   24 |                             cout<<6000-n;
      |                             ~~~~
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int total = scan.nextInt();
    if(noguti%1000!=0){
    int noguti = (total/1000)+ 1;
    }else{
    int noguti = (total/1000);
    }
    System.out.print(1000*noguti - total);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    if(noguti%1000!=0){
       ^
  symbol:   variable noguti
  location: class Main
Main.java:12: error: cannot find symbol
    System.out.print(1000*noguti - total);
                          ^
  symbol:   variable noguti
  location: class Main
2 errors
Language: C

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

int main (void){
    int value,hundred;
    scanf("%d",&value);
    hundred = value /100; //必要な100円玉の枚数
    if(hundred%10 == 0){
        printf("%d",hundred%10);
        hundred = hundred % 10;//100のくらいの数
        printf("%d",&(100*(10-hundred)));
    }
    return 0
}

Compiler output:
main.c: In function 'main':
main.c:12:21: error: lvalue required as unary '&' operand
   12 |         printf("%d",&(100*(10-hundred)));
      |                     ^
main.c:14:13: error: expected ';' before '}' token
   14 |     return 0
      |             ^
      |             ;
   15 | }
      | ~
Language: Java

import java.util.*;
 
class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    if (N%1000 == 0){
      System.out.println(0)
    }else if (N<=1000&&0<N){
      System.out.println(1000-N);
    }else if(1000<N&&N<10000){
      System.out.println(1000-N%1000);
    }
  }
}

Compiler output:
Main.java:8: error: ';' expected
      System.out.println(0)
                           ^
1 error
Language: C++

#include <iostream> 
using namespace std;

int main(void) {

  int N;
  cin >> N;
  for (; N => 1000; N-=1000) {
    ;
  }
  cout << N << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before '>' token
    8 |   for (; N => 1000; N-=1000) {
      |             ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
 
int main(){
	char num[256], str[256];
	int i, nums;
  	int AC = 0;
  	int WA = 0;
  	int TLE = 0;
  	int RE = 0;
	fgets(num, sizeof(num), stdin);
  	nums = atoi(num);
  	for(i = 0; i < nums; i++){
      fgets(str, sizeof(str), stdin);
      if(strcmp(str, "AC\n") == 0){
        	AC++;
      }
      else if(strcmp(str, "WA\n") == 0){
        	WA++;
      }
      else if(strcmp(str, "TLE\n") == 0){
        	TLE++;
      }
      else if(strcmp(str, "RE\n") == 0){
        	RE++;
      }
      else if(strcmp(str, "AC") == 0){
        	AC++;
      }
      else if(strcmp(str, "WA") == 0){
        	WA++;
      }
      else if(strcmp(str, "TLE") == 0){
        	TLE++;
      }
      else if(strcmp(str, "RE") == 0){
        	RE++;
      }
    }  	
  	printf("AC × %d\n", AC);
  	printf("WA × %d\n", WA);
  	printf("TLE × %d\n", TLE);
  	printf("RE × %d\n", RE);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'strcmp' was not declared in this scope
   15 |       if(strcmp(str, "AC\n") == 0){
      |          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<stdlib.h>
  +++ |+#include <cstring>
    3 |
Language: C++

#include<iostream>
using namespace std;
int main{
int n;
  cin>>n;
  n=n%1000;
  if (n==0)
    cout<<n;
  else
  cout<<1000-n;




return 0;
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:1: error: expected primary-expression before 'int'
    4 | int n;
      | ^~~
a.cc:4:1: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin>>n;
      |   ^~~
a.cc:6:3: error: 'n' does not name a type
    6 |   n=n%1000;
      |   ^
a.cc:7:3: error: expected unqualified-id before 'if'
    7 |   if (n==0)
      |   ^~
a.cc:9:3: error: expected unqualified-id before 'else'
    9 |   else
      |   ^~~~
a.cc:15:1: error: expected unqualified-id before 'return'
   15 | return 0;
      | ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C

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

int main(void){
  int i,N;
  int c0,c1,c2,c3;
  char s[N][5];
  
  for(i=0;i<N;i++)
    scanf("%s",s[N]);
  
  for(i=0;i<N;i++){
    if(strcmp(s[N],AC)
       c0++;
       else if(strcmp(s[N],WA)
               c1++;
               else if(strcmp(s[N],TLE)
                       c2++;
                       else if(strcmp(s[N],RE)
       						   c3++;
                               }
                               printf("AC × %d\n",c0);
                               printf("WA × %d\n",c1);
                               printf("TLE × %d\n",c2);
                               printf("RE × %d\n",c3);
                               return 0;
                               }

Compiler output:
main.c: In function 'main':
main.c:14:20: error: 'AC' undeclared (first use in this function)
   14 |     if(strcmp(s[N],AC)
      |                    ^~
main.c:14:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:23: error: expected ')' before 'c0'
   14 |     if(strcmp(s[N],AC)
      |       ~               ^
      |                       )
   15 |        c0++;
      |        ~~              
main.c:28:32: error: expected declaration or statement at end of input
   28 |                                }
      |                                ^
main.c:28:32: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

int main(){
 int N;
 int turi=0;
 int i;
 scanf("%d",&N);
 for(i=1;10=>i;i++){
 	turi=N-1000*i;
    if(turi<1000){
    	printf("turi = %d",turi);
      	break;
    }
 }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:13: error: expected expression before '>' token
    8 |  for(i=1;10=>i;i++){
      |             ^
Language: C

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

int main(void){
  int i,N;
  int c0,c1,c2,c3;
  char s[N][5];
  
  for(i=0;i<N;i++)
    scanf("%s",s[N]);
  
  for(i=0;i<N;i++){
    if(strcmp(s[N],AC)
       c0++;
       else if(strcmp(s[N],WA)
               c1++;
               else if(strcmp(s[N],TLE)
                       c2++;
                       else if(strcmp(s[N],RE)
       						   c3++;
                               }
                               printf("AC × %d\n",c0);
                               printf("WA × %d\n",c1);
                               printf("TLE × %d\n",c2);
                               printf("RE × %d\n",c3);
                               return 0;
                               }

Compiler output:
main.c: In function 'main':
main.c:13:8: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   13 |     if(strcmp(s[N],AC)
      |        ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:13:20: error: 'AC' undeclared (first use in this function)
   13 |     if(strcmp(s[N],AC)
      |                    ^~
main.c:13:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:23: error: expected ')' before 'c0'
   13 |     if(strcmp(s[N],AC)
      |       ~               ^
      |                       )
   14 |        c0++;
      |        ~~              
main.c:27:32: error: expected declaration or statement at end of input
   27 |                                }
      |                                ^
main.c:27:32: error: expected declaration or statement at end of input
Language: C++

#include <iostream>
namespace std

int main(){
	int N ;
	cin >> N;
	cout << 1000 - N%1000
	return 0;                     
}

Compiler output:
a.cc:4:1: error: expected '{' before 'int'
    4 | int main(){
      | ^~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> N;
      |         ^~~
      |         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:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         cout << 1000 - N%1000
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
#include<set>
#include<iterator>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define mod (1000*1000*1000+7)
#define modd (1000*1000*1000+9)
#define flush fflush(stdout)
#define pi 3.14159265358979323846264338327950
#define read_in_arr(a, n) for(int i=0;i<n;i++){ cin>>a[i];}
#define print_arr(a, n) for(int i=0;i<n;i++){ cout<<a[i]<<" ";} cout<<endl;
// cout<<fixed<<setprecision(12)<<ans<<endl;
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
	int n;
	cin>>n;
	int c = n%1000;
	if(c==0){
		cout<<"0"<<endl;
		continue;
	}
	cout<<1000-c<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: continue statement not within a loop
   29 |                 continue;
      |                 ^~~~~~~~
Language: Java

import java.util.*;
 
class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    if (N<=1000){
      System.put.println(1000-N);
    }else{
      System.out.println(answer);
    }
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
      System.put.println(1000-N);
            ^
  symbol:   variable put
  location: class System
Main.java:10: error: cannot find symbol
      System.out.println(answer);
                         ^
  symbol:   variable answer
  location: class Main
2 errors
Language: C++

#incldue<bits.stdc++.h>
using namespace std;
int n; 
int main()
{
	cin>>n;
    n=n%1000;
    cout<<1000-n<<endl;
	return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits.stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>n;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue<bits.stdc++.h>
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout<<1000-n<<endl;
      |     ^~~~
a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:19: error: 'endl' was not declared in this scope
    8 |     cout<<1000-n<<endl;
      |                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incldue<bits.stdc++.h>
Language: Java

import java.util.Scanner;

public class main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int total = scan.nextInt();
    int noguti = total/1000 + 1;
    System.out.println(1000*noguti - total);
  }
}

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

#incldue<bits.stdc++.h>
using namespace std;
int n; 
int main()
{
    n=n%1000;
    cout<<1000-n<<endl;
	return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits.stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:5: error: 'cout' was not declared in this scope
    7 |     cout<<1000-n<<endl;
      |     ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue<bits.stdc++.h>
a.cc:7:19: error: 'endl' was not declared in this scope
    7 |     cout<<1000-n<<endl;
      |                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incldue<bits.stdc++.h>
Language: C

#include <stdio.h>
int main(void){
    int N;
    scanf("%d",&N);
    int m = N/1000;
    if(N%1000 == 0){m = 1000*m;}
    m = 1000*(m+1);
    int ans = m - N;
    print(ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    9 |     print(ans);
      |     ^~~~~
      |     printf
Language: C++

#include <bits/#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, otsuri,answer;
  cin >> N;
  for (int i=1; (i-1)*1000<N; i++) {
    answer=i;
  }
  otsuri=answer*1000-N;
  cout<< otsuri<< endl;
}

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

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

int main() {
	float n;cin >> n;
	n /= 1000;
	float val = (ceil(n) - n)*1000;
	cout << val << "\n;
	return 0;
}

Compiler output:
a.cc:8:24: warning: missing terminating " character
    8 |         cout << val << "\n;
      |                        ^
a.cc:8:24: error: missing terminating " character
    8 |         cout << val << "\n;
      |                        ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: expected primary-expression before 'return'
    9 |         return 0;
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int32_t main() {
    fastio
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int N;
    cin >> N;
    int result;
    if (N <= 1000)
        result = 0;
    else
        result = N % 1000;
    cout << result << '\n';
    return 0;

}


Compiler output:
a.cc:2:103: error: stray '#' in program
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                       ^
a.cc:2:104: error: 'define' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                        ^~~~~~
a.cc:2:148: error: 'cin' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                                                                    ^~~
a.cc:2:160: error: 'cout' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                                                                                ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int k,n;
  cin >> k >> n;
  if(n/1000=k){
  cout << n-1000*k << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: lvalue required as left operand of assignment
    6 |   if(n/1000=k){
      |      ~^~~~~
Language: C

#include<stdio.h>

    int change, product;

    scanf("%d", &product);
 change = product % 1000;
   printf("%d\n", change);

Compiler output:
main.c:5:11: error: expected declaration specifiers or '...' before string constant
    5 |     scanf("%d", &product);
      |           ^~~~
main.c:5:17: error: expected declaration specifiers or '...' before '&' token
    5 |     scanf("%d", &product);
      |                 ^
main.c:6:2: warning: data definition has no type or storage class
    6 |  change = product % 1000;
      |  ^~~~~~
main.c:6:2: error: type defaults to 'int' in declaration of 'change' [-Wimplicit-int]
main.c:6:11: error: initializer element is not constant
    6 |  change = product % 1000;
      |           ^~~~~~~
main.c:7:11: error: expected declaration specifiers or '...' before string constant
    7 |    printf("%d\n", change);
      |           ^~~~~~
main.c:7:19: error: expected declaration specifiers or '...' before 'change'
    7 |    printf("%d\n", change);
      |                   ^~~~~~
Language: Java

package com.go.atcoder.contest.oneseventhree;

import java.util.Scanner;  // Import the Scanner class

public class Payment {

    public static void main(String[] args) {
        int res = 0;
        Scanner in = new Scanner(System.in);
        int amt = in.nextInt();
        res = solve(amt);
        System.out.println("res :" + res);
    }

    public static int solve(int inp) {
        System.out.println("given money : " + inp);
        int rem = inp % 1000;
        return (rem != 0) ? 1000 - rem : 0;
    }
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, otsuri;
  cin >> N;
  for (int i=1; (i-1)*1000<N; i++) {
    int answer;
    answer=i;
  }
  otsuri=answer*1000-N;
  cout<< N<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'answer' was not declared in this scope
   10 |   otsuri=answer*1000-N;
      |          ^~~~~~
Language: Java

#include<stdio.h>
int main()
{
  int n,change;
  scanf("%d",&n);
 if(n>=1 && n<=10000) 
 {
   change=n%1000;
 }
  printf("%d",change);
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:5: error: class, interface, enum, or record expected
  scanf("%d",&n);
  ^
Main.java:6: error: class, interface, enum, or record expected
 if(n>=1 && n<=10000) 
 ^
Main.java:9: error: class, interface, enum, or record expected
 }
 ^
Main.java:11: error: class, interface, enum, or record expected
}
^
6 errors
Language: C++

n = int(input())
print(((n - 1) // 1000 + 1) * 1000 - n)
# for ttt in range(int(input())):
# 	#n = int(input())
# 	#l = list(map(int, input().split()))
# 	# a, b, n = map(int, input().split())
# 	# x = 0
# 	# if a > b:
# 	# 	a, b = b, a
# 	# while b <= n:
# 	# 	a, b = b, a + b
# 	# 	x += 1
# 	# print(x)
# 	s = input()
# 	if len(s) <= 10:
# 		print(s)
# 	else:
# 		print(s[0] + str(len(s) - 2) + s[-1])

Compiler output:
a.cc:3:3: error: invalid preprocessing directive #for
    3 | # for ttt in range(int(input())):
      |   ^~~
a.cc:4:9: error: invalid preprocessing directive ##
    4 | #       #n = int(input())
      |         ^
a.cc:5:9: error: invalid preprocessing directive ##
    5 | #       #l = list(map(int, input().split()))
      |         ^
a.cc:6:9: error: invalid preprocessing directive ##
    6 | #       # a, b, n = map(int, input().split())
      |         ^
a.cc:7:9: error: invalid preprocessing directive ##
    7 | #       # x = 0
      |         ^
a.cc:8:9: error: invalid preprocessing directive ##
    8 | #       # if a > b:
      |         ^
a.cc:9:9: error: invalid preprocessing directive ##
    9 | #       #       a, b = b, a
      |         ^
a.cc:10:9: error: invalid preprocessing directive ##
   10 | #       # while b <= n:
      |         ^
a.cc:11:9: error: invalid preprocessing directive ##
   11 | #       #       a, b = b, a + b
      |         ^
a.cc:12:9: error: invalid preprocessing directive ##
   12 | #       #       x += 1
      |         ^
a.cc:13:9: error: invalid preprocessing directive ##
   13 | #       # print(x)
      |         ^
a.cc:14:9: error: invalid preprocessing directive #s
   14 | #       s = input()
      |         ^
a.cc:15:15: error: missing binary operator before token "("
   15 | #       if len(s) <= 10:
      |               ^
a.cc:17:13: warning: extra tokens at end of #else directive [-Wendif-labels]
   17 | #       else:
      |             ^
a.cc:18:17: error: invalid preprocessing directive #print
   18 | #               print(s[0] + str(len(s) - 2) + s[-1])
      |                 ^~~~~
a.cc:15: error: unterminated #else
   15 | #       if len(s) <= 10:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int k,n;
  cin >> k >> n;
  if(n/1000=k){
  cout << n-1000*k << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: lvalue required as left operand of assignment
    6 |   if(n/1000=k){
      |      ~^~~~~
Language: C++

#include<iostream>
int main(){
int a,b;
cin>>a;
b = a%1000;
if(b==0)cout<<0<<endl;
else cout<<1000-b<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 | cin>>a;
      | ^~~
      | 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:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | if(b==0)cout<<0<<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:6:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 | if(b==0)cout<<0<<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:7:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 | else cout<<1000-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:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 | else cout<<1000-b<<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<bits/stdc++.h>
using namespace std;
int main()
{

    int x,y,n;
    cin>>n;
    int x=1000;
    while(1)
    {
        if(x>=n)
        {
            cout<<n-x<<endl;
            break;
        }
        x=x+1000;
        
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: redeclaration of 'int x'
    8 |     int x=1000;
      |         ^
a.cc:6:9: note: 'int x' previously declared here
    6 |     int x,y,n;
      |         ^
Language: C

#include <iostream>
using namespace std;

int main()
{
  int n;
  cin >> n;
  int ans;
  ans = 1000 - n%1000;
  cout << ans;
}


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

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


Compiler output:
main.c: In function 'main':
main.c:7:22: error: expected ';' before 'else'
    7 |   printf("%d",n%1000)
      |                      ^
      |                      ;
    8 |   else
      |   ~~~~
Language: C++

#include <bits/stdc++.h>
//For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test int t; cin>>t; while(t--)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopr(i,a,b) for(int i=a;i>=b;i--)
#define loops(i,a,b,step) for(int i=a;i<b;i+=step)
#define looprs(i,a,b,step) for(int i=a;i>=b;i-=step)
#define ull unsigned long long int
#define ll long long int
#define P pair
#define PLL pair<long long, long long>
#define PII pair<int, int>
#define PUU pair<unsigned long long int, unsigned long long int>
#define L list
#define V vector
#define D deque
#define ST set
#define MS multiset
#define M map
#define UM unordered_map
#define mp make_pair
#define pb push_back
#define pf push_front
#define MM multimap
#define F first
#define S second
#define IT iterator
#define RIT reverse_iterator
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define all(a) a.begin(),a.end()
using namespace std;
// For ordered_set
using namespace __gnu_pbds;
template <typename T>
using ord_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const ll maxn = 1e5;
const ll inf = 1e9;
const double pi = acos(-1);

void solve(){
    ll n;
    cin >> n;
    n = n % 1000;
  	if(n==0)
      cout << 0 << "\n"
   	else cout << abs(1000 - n) << "\n";
}

int main(){
   int t = 1;
   //cin >> t;
   while(t--){
       solve();
   }
   return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:51:24: error: expected ';' before 'else'
   51 |       cout << 0 << "\n"
      |                        ^
      |                        ;
   52 |         else cout << abs(1000 - n) << "\n";
      |         ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{

    int x,y;
    cin>>n;
    int x=1000;
    while(1)
    {
        if(x>=n)
        {
            cout<<n-x<<endl;
            break;
        }
        x=x+1000;
        
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 |     cin>>n;
      |          ^
a.cc:8:9: error: redeclaration of 'int x'
    8 |     int x=1000;
      |         ^
a.cc:6:9: note: 'int x' previously declared here
    6 |     int x,y;
      |         ^
Language: C++

#include <iostream>

ussing namespace std;

int main(){
    int N;
    cin >> N;
    int ans = 0;
    ans = N % 1000;
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:3:1: error: 'ussing' does not name a type
    3 | ussing namespace std;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin >> N;
      |     ^~~
      |     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:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout << ans << 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:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     cout << ans << 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)
      |     ^~~~
Language: C

#include<stdio.h>
int main(){
    int a,i,b;
    scanf("%d",&a);
    for (i=0; i<10; i++){
        //if ( (i*1000) < a <= ((i+1)*1000)){
        if (a - (i+1)*1000 <= 0 ){
            b = (i+1)*1000-a;
            printf("%d\n",b);
            break;
        }
    }
    return 0;

Compiler output:
main.c: In function 'main':
main.c:13:5: error: expected declaration or statement at end of input
   13 |     return 0;
      |     ^~~~~~
Language: Java

import java.util.Scanner;

public class payment {

    public static void main(String[] args) {

        Scanner sc=  new Scanner(System.in);

        int num = sc.nextInt();

        float f = num/1000f;

        int l = (int)(Math.ceil(f));
        System.out.println(l*1000-num);
    }
}


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

import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int rest = n%1000;
		if(rest==0) System.out.println(0);
		else System.out.println(1000-rest);

	}

}


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



import java.util.Scanner;

public class payment {

    public static void main(String[] args) {

        Scanner sc=  new Scanner(System.in);

        int num = sc.nextInt();

        float f = num/1000f;

        int l = (int)(Math.ceil(f));
        System.out.println(l*1000-num);
    }
}


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

#include<iostream>
using namespace std;
int main()
{
	long long n;
	cin>>n;
	if(n%1000==0)
	{
		cout<<0;
	}
	else{
		cout<<1000-n%1000;
	}
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);


int32_t main() {
    fastio
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int N;
    cin >> N;
    int result;
    if (N <= 1000)
        result = 0;
    else
        result = N % 1000;
    cout << result << '\n';
    return 0;

}


Compiler output:
a.cc:2:103: error: stray '#' in program
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                       ^
a.cc:2:104: error: 'define' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                        ^~~~~~
a.cc:2:148: error: 'cin' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                                                                    ^~~
a.cc:2:160: error: 'cout' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                                                                                ^~~~
a.cc: In function 'int32_t main()':
a.cc:6:5: error: 'fastio' was not declared in this scope
    6 |     fastio
      |     ^~~~~~
Language: Java

import java.util.Scanner;
public class A {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		N = (10000 - N) % 1000; 
		System.out.println(N);
	}

}


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

#include <stdio.h>

int main(){
 int N-3000;
 int turi=0;
 int i;
 for(i=0;10>i;i++){
 	turi=N-1000*i;
    if(turi<1000){
    	printf("turi = %d",turi);
    }
 }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
    4 |  int N-3000;
      |       ^
main.c:8:14: error: 'N' undeclared (first use in this function)
    8 |         turi=N-1000*i;
      |              ^
main.c:8:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);


int32_t main() {
    fastio
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int N;
    cin >> N;
    int result;
    if (N <= 1000)
        result = 0;
    else
        result = N % 1000;
    cout << result << '\n;
    return 0;

}

Compiler output:
a.cc:2:103: error: stray '#' in program
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                       ^
a.cc:18:23: warning: missing terminating ' character
   18 |     cout << result << '\n;
      |                       ^
a.cc:18:23: error: missing terminating ' character
   18 |     cout << result << '\n;
      |                       ^~~~
a.cc:2:104: error: 'define' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                        ^~~~~~
a.cc:2:148: error: 'cin' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                                                                    ^~~
a.cc:2:160: error: 'cout' does not name a type
    2 | using namespace std;                                                                                  #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                                                                                                                                ^~~~
a.cc: In function 'int32_t main()':
a.cc:6:5: error: 'fastio' was not declared in this scope
    6 |     fastio
      |     ^~~~~~
a.cc:19:5: error: expected primary-expression before 'return'
   19 |     return 0;
      |     ^~~~~~
Language: Java



import java.util.Scanner;

public class Contest {

    public static void main(String[] args) {

        Scanner sc=  new Scanner(System.in);

        int num = sc.nextInt();

        float f = num/1000f;

        int l = (int)(Math.ceil(f));
        System.out.println(l*1000-num);
    }
}


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

#include<iostream>
using namespace std;
int main(){
  int a,b;
  cin>> a;
  while(a>0){
    b=a-1000;
    a=b;
  }
  cout<< |a| <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected primary-expression before '|' token
   10 |   cout<< |a| <<endl;
      |          ^
a.cc:10:14: error: expected primary-expression before '<<' token
   10 |   cout<< |a| <<endl;
      |              ^~
Language: C

#include <stdio.h>
int main (){
  int N=0,i=0;
  scanf("%d",&N)
  for(i=0;N>0;i++){
    N=N-1000;
  }
  N=N+1000;
  printf("%d",N);
}

Compiler output:
main.c: In function 'main':
main.c:4:17: error: expected ';' before 'for'
    4 |   scanf("%d",&N)
      |                 ^
      |                 ;
    5 |   for(i=0;N>0;i++){
      |   ~~~
Language: C++

int main()
{
  unsigned long int N;
  unsigned long int bal;
  std::cin>>N;
  if(N<5000)
  {
    if(N<1000)
    {
      bal=1000-N;
    }
    else if(N>=1000 && N<2000)
    {
      bal=2000-N;
    }
  	else if(N>=2000 && N<3000)
    {
      bal=3000-N;
    }
    else if(N>=3000 && N<4000)
    {
      bal=4000-N;
    }
    else if(N>4000)  
    {	
      bal=5000-N;
  
    }
  }
   else 
  {
    if(N<6000)
    {
      bal=6000-N;
    }
    else if(N>=6000 && N<7000)
    {
      bal=7000-N;
    }
  	else if(N>=7000 && N<8000)
    {
      bal=8000-N;
    }
    else if(N>=8000 && N<9000)
    {
      bal=9000-N;
    }
    else if(N>9000)  
    {	
      bal=10000-N;
  
    }
  }
 std::cout<<bal<<std::endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'cin' is not a member of 'std'
    5 |   std::cin>>N;
      |        ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main()
a.cc:54:7: error: 'cout' is not a member of 'std'
   54 |  std::cout<<bal<<std::endl;
      |       ^~~~
a.cc:54:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:54:23: error: 'endl' is not a member of 'std'
   54 |  std::cout<<bal<<std::endl;
      |                       ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main()
Language: C++

#include <iostream>

int main() {
  int a;
  std::cin >> a;
  while(1) {
    a -= 1000
    if(a < 0) {
      a *= -1
    }
  }
  std::cout << a << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected ';' before 'if'
    7 |     a -= 1000
      |              ^
      |              ;
    8 |     if(a < 0) {
      |     ~~
Language: C

#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n%1000==0)
	{
		cout<<0;
	}
	else{
		cout<<1000-n%1000;
	}
	return 0;
}

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

#include<stdio.h>

int main()
{
    int N;
    scanf("%d", &N);
    int mod = N%1000;
    if(mod==0)
    {
        printf("0\n");
    }
    else
    {
        printf("%d\n", abs(mod-1000));
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: 'abs' was not declared in this scope
   14 |         printf("%d\n", abs(mod-1000));
      |                        ^~~
Language: Java

import java.util.*;
import java.io.*;


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

        Scanner scan = new Scanner(System.in);
        int value = scan.nextInt();
        int count = 1;

        while(count * 1000 < value){
            count++;
        }
        System.out.println((count * 1000) - value);
    }
}


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

import jav.util.Scanner;
public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in); 
    int a  = sc.nextInt();
    int r = a % 1000;
    int s = 1000 - r;
    
    System.out.println(s);
  }
}                          


Compiler output:
Main.java:1: error: package jav.util does not exist
import jav.util.Scanner;
               ^
Main.java:6: error: cannot find symbol
    Scanner sc = new Scanner(System.in); 
    ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
    Scanner sc = new Scanner(System.in); 
                     ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

int main() {
	int n;
	cin >> n;
	if (n % 1000 == 0) {
		cout << 0;
		return 0;
	}
	cout << 1000 - n % 1000 << 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:5:17: error: 'cout' was not declared in this scope
    5 |                 cout << 0;
      |                 ^~~~
a.cc:8:9: error: 'cout' was not declared in this scope
    8 |         cout << 1000 - n % 1000 << endl;
      |         ^~~~
a.cc:8:36: error: 'endl' was not declared in this scope
    8 |         cout << 1000 - n % 1000 << endl;
      |                                    ^~~~
Language: Java

import jav.util.Scanner;
public class Main
{
  public static void main(String[] args
  {
    Scanner sc = new Scanner(System.in); 
    int a  = sc.nextInt();
    int r = a % 1000;
    int s = 1000 - r;
    
    System.out.println(s);
  }
}                          

Compiler output:
Main.java:4: error: ',', ')', or '[' expected
  public static void main(String[] args
                                       ^
1 error