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

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n; string s;
  int count1=0; int count2=0; int count3=0; int count4=0;
  while(n--)
  {
    cin>>s;
    if (s== "AC")
    {
    count1++;}
  
  
  
   else if (s== "WA")
    {
    count2++;}
  
 
 
 else if (s== "TLE")
    {
    count3++;}
  
 
 
 else (s== "RE")
    {
    count4++;}
  
 
}
cout<<"AC x " <<count1<<endl;
 
cout<<"WA x  " <<count2<<endl;
 
cout<<"TLE x " <<count3<<endl;
 
cout<<"RE x " <<count4;
 
  
}
#include<bits/stdc++.h>
using namespace std;
int main(){
 int n; string s;
  int count1=0; int count2=0; int count3=0; int count4=0;
  while(n--)
  {
    cin>>s;
    if (s== "AC")
    {
    count1++;}
  
  
  
   else if (s== "WA")
    {
    count2++;}
  
 
 
 else if (s== "TLE")
    {
    count3++;}
  
 
 
 else 
    count4++;
  
 
}
cout<<"AC x " <<count1<<endl;
 
cout<<"WA x  " <<count2<<endl;
 
cout<<"TLE x " <<count3<<endl;
 
cout<<"RE x " <<count4;
 
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: expected ';' before '{' token
   27 |  else (s== "RE")
      |                 ^
      |                 ;
   28 |     {
      |     ~            
a.cc:27:9: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   27 |  else (s== "RE")
      |       ~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc: At global scope:
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n; string s;
  int count1=0; int count2=0; int count3=0; int count4=0;
  while(n--)
  {
    cin>>s;
    if (s== "AC")
    {
    count1++;}
  
  
  
   else if (s== "WA")
    {
    count2++;}
  
 
 
 else if (s== "TLE")
    {
    count3++;}
  
 
 
 else (s== "RE")
    {
    count4++;}
  
 
}
cout<<"AC x " <<count1<<endl;
 
cout<<"WA x  " <<count2<<endl;
 
cout<<"TLE x " <<count3<<endl;
 
cout<<"RE x " <<count4;
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: expected ';' before '{' token
   27 |  else (s== "RE")
      |                 ^
      |                 ;
   28 |     {
      |     ~            
a.cc:27:9: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   27 |  else (s== "RE")
      |       ~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define rep(i,ini,n) for(ll i=ini;i<(int)n;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x)     x.begin(),x.end()
#define tc   int tt; scf(tt); while(tt--)
#define inf INT_MAX
#define ninf INT_MIN
#define gcd __gcd
#define bitcount(n) __builtin_popcount(n)
typedef double dd;
using namespace std;
const ll mod =1e9+7;
const int N = 1e6+7;
 
 
 
ll power(ll a, ll b)
{
    if(b==0)
    return 1;
    if(b%2==0)
    return power((a*a)%mod,b/2)%mod;
    else
    return (a*power((a*a)%mod,b/2))%mod;
}
 
ll fact(ll n)
{
    if(n==0)
    return 1;
    return (n*fact(n-1))%mod;
}
 
int main{
 int n; string s;
  int count1=0; int count2=0; int count3=0; int count4=0;
  while(n--)
  {
    cin>>s;
    if (s== "AC")
    {
    count1++;}
  
  
  
   if (s== "WA")
    {
    count1++;}
  
 
 
 if (s== "TLE")
    {
    count1++;}
  
 
 
 if (s== "RE")
    {
    count1++;}
  
 
}
cout<<"AC x" " " count1<<endl;
 
cout<<"WA x"  " " count2<<endl;
 
cout<<"TLE x" " " count3<<endl;
 
cout<<"RE x" " " <<count4;
 
  
}

Compiler output:
a.cc:44:5: error: cannot declare '::main' to be a global variable
   44 | int main{
      |     ^~~~
a.cc:45:2: error: expected primary-expression before 'int'
   45 |  int n; string s;
      |  ^~~
a.cc:45:2: error: expected '}' before 'int'
a.cc:44:9: note: to match this '{'
   44 | int main{
      |         ^
a.cc:47:3: error: expected unqualified-id before 'while'
   47 |   while(n--)
      |   ^~~~~
a.cc:74:1: error: 'cout' does not name a type
   74 | cout<<"AC x" " " count1<<endl;
      | ^~~~
a.cc:76:1: error: 'cout' does not name a type
   76 | cout<<"WA x"  " " count2<<endl;
      | ^~~~
a.cc:78:1: error: 'cout' does not name a type
   78 | cout<<"TLE x" " " count3<<endl;
      | ^~~~
a.cc:80:1: error: 'cout' does not name a type
   80 | cout<<"RE x" " " <<count4;
      | ^~~~
a.cc:83:1: error: expected declaration before '}' token
   83 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
3 int main(){
4 int N;
5 cin >> N;
6 cout << (1000 - N % 1000) % 1000 << endl;
7 }


Compiler output:
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3 int main(){
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'N' was not declared in this scope
   11 | cout << (1000 - N % 1000) % 1000 << endl;
      |                 ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: expected '}' at end of input
   10 |     cout << n - (n % 1000) << endl;
      |                                    ^
a.cc:9:7: note: to match this '{'
    9 |   else{
      |       ^
a.cc:10:36: error: expected '}' at end of input
   10 |     cout << n - (n % 1000) << endl;
      |                                    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

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

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:12: error: expected expression before '=' token
    5 | if(N%1000!==0)
      |            ^
Language: C

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:12: error: expected expression before '=' token
    5 | if(N%1000!==0)
      |            ^
main.c:8:22: error: expected ';' before 'return'
    8 |   printf("%d",N%1000)
      |                      ^
      |                      ;
    9 | 
   10 |   return 0;
      |   ~~~~~~
Language: C

#include <stdio.h>
int main(void){
  int N;
  scanf("%d",%N)
  printf("%d\n",N%1000);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:14: error: expected expression before '%' token
    4 |   scanf("%d",%N)
      |              ^
main.c:4:17: error: expected ';' before 'printf'
    4 |   scanf("%d",%N)
      |                 ^
      |                 ;
    5 |   printf("%d\n",N%1000);
      |   ~~~~~~
Language: C

#include <stdio.h>
 
int main(void){
  int num;
  scanf("%d", &num);
  printf("%d", (1000 - n%1000)%1000);
}

Compiler output:
main.c: In function 'main':
main.c:6:24: error: 'n' undeclared (first use in this function)
    6 |   printf("%d", (1000 - n%1000)%1000);
      |                        ^
main.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void)
{
  int num;
  
  scanf("%d", &num);
  
  for(int i = 0;num < i;i = i + 1000){
    i = i - num;
  }
  
  printf("%d", i);
}

Compiler output:
main.c: In function 'main':
main.c:13:16: error: 'i' undeclared (first use in this function)
   13 |   printf("%d", i);
      |                ^
main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

main()
{
	int N;
	cin>>N;
	if(N>=0&&N<=10000)
		cout<<(1000-N%1000)<<endl;
	else 
		return;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |                 return;
      |                 ^~~~~~
Language: Java

package Facebook;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      System.out.println(1000 - n);
    }
}


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

import java.util.Scanner;

public class Practice0708 {
    public static void main(String[] args) {
        //N円の商品を1000円札のみで買い、お釣りを表示
        Scanner sc = new Scanner(System.in);
        System.out.print("入力:");
        int N = sc.nextInt();
        int money = 1000;

 

        if (N % money == 0) {//お釣りなし
            System.out.println(0);
        }else {//お釣りあり
            money = (N/money +1)*1000;
            System.out.println(money-N);
        }
    }

 

}

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

public class CodeTest {
    public static void main(String[] args) {
        int n = new java.util.Scanner(System.in).nextInt();
        int a;
        if(n % 1000 == 0) {
            a = n / 1000;
        } else {
            a = (n / 1000) + 1;
        }
        int b = a * 1000;
        int result = b - n;
        System.out.println(result);
    }
}

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

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

using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) (v).begin(), (v).end()
#define sz(v) (int) (v).size()

int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  cin >> n;
  cout << 1000 - (k % 1000) << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:14:19: error: 'k' was not declared in this scope
   14 |   cout << 1000 - (k % 1000) << '\n';
      |                   ^
Language: C++

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

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~
Language: C++

#inclde<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n;
	cin >> n;
	if (n%1000)
		cout << (n-(n%1000));
	else
		cout << "0\n";

	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         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 | #inclde<bits/stdc++.h>
a.cc:9:17: error: 'cout' was not declared in this scope
    9 |                 cout << (n-(n%1000));
      |                 ^~~~
a.cc:9:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:17: error: 'cout' was not declared in this scope
   11 |                 cout << "0\n";
      |                 ^~~~
a.cc:11:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <stdio.h>

int main(void) {
    char N[6];
    int n;
    gets(N);
    sscanf(N, "%d", &n);
    if(n % 1000 == 0){
        printf("0");
        return 0;
    }
    printf("%d",1000 - (n % 1000));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(N);
      |     ^~~~
      |     getw
Language: Java

public class Main {
    public static void main(String[] args){
        try {
            PrintWriter out=new PrintWriter(System.out,true);
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            int t=Integer.parseInt(br.readLine());
            t=t%1000;
            t=1000-t;
            if(t==1000){
                t=0;
            }
            out.println(t);
            out.close();
        } catch (Exception e) {
            System.out.println("kkkk "+ e.getMessage());
        }

    }
}

Compiler output:
Main.java:4: error: cannot find symbol
            PrintWriter out=new PrintWriter(System.out,true);
            ^
  symbol:   class PrintWriter
  location: class Main
Main.java:4: error: cannot find symbol
            PrintWriter out=new PrintWriter(System.out,true);
                                ^
  symbol:   class PrintWriter
  location: class Main
Main.java:5: error: cannot find symbol
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                                  ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                                                     ^
  symbol:   class InputStreamReader
  location: class Main
5 errors
Language: C++

#include<iostream>

int main()
{
	int n;
  cin>>n;
  int ans;
  int a;
  a = n%1000;
  ans = (a + 1)*1000 - n;
  cout<<ans;
  return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: 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:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout<<ans;
      |   ^~~~
      |   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 <stdio.h>
int main( void ) {
scanf(”&d”, &d,);
  for(int i = 0;&d <= i;i == i + 1000){
    i == i - &d
  printf( "i\n" );
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:7: error: stray '\342' in program
    3 | scanf(<U+201D>&d<U+201D>, &d,);
      |       ^~~~~~~~
main.c:3:10: error: stray '\342' in program
    3 | scanf(<U+201D>&d<U+201D>, &d,);
      |                 ^~~~~~~~
main.c:3:9: error: 'd' undeclared (first use in this function)
    3 | scanf(”&d”, &d,);
      |         ^
main.c:3:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:16: error: expected expression before ')' token
    3 | scanf(”&d”, &d,);
      |                ^
main.c:5:16: error: expected ';' before 'printf'
    5 |     i == i - &d
      |                ^
      |                ;
    6 |   printf( "i\n" );
      |   ~~~~~~        
main.c:8:1: error: expected declaration or statement at end of input
    8 | }
      | ^
Language: C

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

int main(){
    int a;
    scanf("%d",&a);
    if(a%1000!=0){
        printf("%d",1000-a%1000) ;
    }
    else{printf("0")}
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:21: error: expected ';' before '}' token
   10 |     else{printf("0")}
      |                     ^
      |                     ;
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int pien=1000;
        int otsri=0;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int amari = N%pien;
        if(amari != 0){
             otsuri = pien-amari;
        }else{
            otsuri = amari;
        }
        System.out.println(oturi);
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
             otsuri = pien-amari;
             ^
  symbol:   variable otsuri
  location: class Main
Main.java:13: error: cannot find symbol
            otsuri = amari;
            ^
  symbol:   variable otsuri
  location: class Main
Main.java:15: error: cannot find symbol
        System.out.println(oturi);
                           ^
  symbol:   variable oturi
  location: class Main
3 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int pien=1000;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int amari = N%pien;
        if(amari != 0){
            int otsuri = pien-amari;
        }else{
            int otsuri = amari;
        }
        System.out.println(oturi);
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
        System.out.println(oturi);
                           ^
  symbol:   variable oturi
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int pien=1000;
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int amari = N%pien;
        if(otsuri != 0){
            int otsuri = pien-amari;
        }else{
            int otsuri = amari;
        }
        System.out.println(oturi);
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        if(otsuri != 0){
           ^
  symbol:   variable otsuri
  location: class Main
Main.java:14: error: cannot find symbol
        System.out.println(oturi);
                           ^
  symbol:   variable oturi
  location: class Main
2 errors
Language: C

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

int main(){
    gcc(0);
    int a, b;
    scanf("%d", a);
    printf("(1000 - a / 1000) / 1000",&b) ;
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'gcc' [-Wimplicit-function-declaration]
    5 |     gcc(0);
      |     ^~~
Language: C

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

int main(){
    gcc(0);
    int a, b;
    scanf("%d", a);
    printf("(1000 - a % 1000) % 1000",&b) ;
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'gcc' [-Wimplicit-function-declaration]
    5 |     gcc(0);
      |     ^~~
Language: C

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

int main(){
    int a,b;
    scanf("%d", &a);
    ((1000 - a *10) *10) = b ;
    printf("%d", &b);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:26: error: lvalue required as left operand of assignment
    7 |     ((1000 - a *10) *10) = b ;
      |                          ^
Language: C

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

int main(){
    int a,b;
    scanf("%d", a);
    ((1000 - a *10) *10) = b ;
    printf("%d");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:26: error: lvalue required as left operand of assignment
    7 |     ((1000 - a *10) *10) = b ;
      |                          ^
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:27: error: lvalue required as left operand of assignment
    6 |     if (1000 - (N % 1000) = 1000) {
      |                           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |     return;
      |     ^~~~~~
a.cc:16:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   16 |   return;
      |   ^~~~~~
Language: C++

#include<iostream>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> 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:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << 1000-m;
      |   ^~~~
      |   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 <cstdio.h>

int main() {
  int n;
  scanf("%d", &n);
  if (n%1000) printf("%d\n", 1000 - n%1000);
  else puts("0");
}

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

#include <cstdio.h>

int main() {
  int n;
  scanf("%d", &n);
  (n%1000)? printf("%d\n", 1000 - n%1000) : puts("0");
}

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

#include <stdio.h>
int main()
{
	int n;
  	printf("input the price");
  	scanf("%d",&n);
	if (n<1000)
    {
    	printf("the exchange is %d"，1000-n);
    }
  	else if(n>1000)
    {
    	int b;
      	b=n%1000;
      	if (b!=0)
        {printf("the exchange is %d",1000-b);}
        else{printf("the exchange is 0");}
    }
}

Compiler output:
main.c: In function 'main':
main.c:9:36: error: expected ')' before '\U0000ff0c1000'
    9 |         printf("the exchange is %d"，1000-n);
      |               ~                    ^~~~~~
      |                                    )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  for(int i = 1, i <= 10 , i++){
    int C = (i*1000) - N;
    if(C <= 0) {
      cout << C + 1000 << endl;
      break;
    }
    else {
      continue;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected ';' before '<=' token
    6 |   for(int i = 1, i <= 10 , i++){
      |                   ^~~
      |                   ;
a.cc:6:20: error: expected primary-expression before '<=' token
    6 |   for(int i = 1, i <= 10 , i++){
      |                    ^~
a.cc:6:31: error: expected ';' before ')' token
    6 |   for(int i = 1, i <= 10 , i++){
      |                               ^
      |                               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main{
  int N;
  cin >> N;
  for(int i = 1, i <= 10 , i++){
    int C = (i*1000) - N;
    if(C <= 0) {
      cout << C + 1000 << endl;
      break;
    }
    else {
      continue;
    }
  }
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int N;
      |   ^~~
a.cc:4:3: 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: expected unqualified-id before 'for'
    6 |   for(int i = 1, i <= 10 , i++){
      |   ^~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main{
  int N;
  cin >> N;
  for(int i = 0, i <= 10 , i++){
    int C = (i*1000) - N;
    if(C > 0) {
      continue;
    }
    else {
      cout << C + 1000 << endl;
      break;
    }
  }
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int N;
      |   ^~~
a.cc:4:3: 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: expected unqualified-id before 'for'
    6 |   for(int i = 0, i <= 10 , i++){
      |   ^~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include <iostream>
int main(){
  	int N;
  	cin >> N;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |         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
      |                  ^~~
Language: Java

import java.util.Scanner;
 
public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = scanner.nextInt();
    
    for (int i = 1; i < 11; i++) {
      int bill = 1000*i;
      if (num > bill) {
      	continue;  
      } else {
        int answer = bill-num;
        return answer;
      }
    }
  }
}

Compiler output:
Main.java:14: error: incompatible types: unexpected return value
        return answer;
               ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = scanner.nextInt();
    
    for (int i = 1; i < 11; i++) {
      int bill = 1000*i;
      if (num > bill) {
      	continue;  
      } else {
        return bill-num;
      }
    }
  }
}

Compiler output:
Main.java:13: error: incompatible types: unexpected return value
        return bill-num;
                   ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = scanner.nextInt();
    
    for (int i = 1; i < 11; i++) {
      int bill = 1000*i
      if (num > bill) {
      	continue;  
      } else {
        return bill-num;
      }
    }
  }
}

Compiler output:
Main.java:9: error: ';' expected
      int bill = 1000*i
                       ^
1 error
Language: C

#include <stdio.h>
 
int main(void)
{
  int m;
  char str[6];
   
  fgets(str,sizeof(str),stdin);
  sscanf(str,"%d",&m);
  
  printf("%d",(int)(1000-m%1000)％1000);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:33: error: expected ')' before '\U0000ff051000'
   11 |   printf("%d",(int)(1000-m%1000)％1000);
      |         ~                       ^~~~~~
      |                                 )
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int bill = 1000;
      if(N>=bill)
      {
        while(N>bill)
        {
            bill = bill + 1000; 
        }
        System.out.println(bill-N);
      }
      else
      	System.out.println(0);
    }
}

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

#inlcude <bits/stdc++.h>

using namespace std;
int main()
{
	int n;
  cin>>n;
  cout<<(1000-n%1000)%1000<<"\n";
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   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 | #inlcude <bits/stdc++.h>
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout<<(1000-n%1000)%1000<<"\n";
      |   ^~~~
a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while (n > 0) {
            n -= 1000;
        }
        System.out.println(Math.abs(n));
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

#define rep(i,n) for(ll i = 0; i < n; i++)
#define per(i,n) for(ll i = n-1; i >= 0; i--)
#define REP(i,n) for(ll i = 1; i < n; i++)
#define PER(i,n) for(ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPP = vector<vP>;
using vPl = vector<Pl>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

Compiler output:
a.cc: In function 'int main()':
a.cc:42:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |   ans = 1000 - n % 1000;
      |   ^~~
      |   abs
Language: C

#include <stdio.h>

int main()
{
	int n, a;
	scanf("%d", &n);
  　a = 1000 - n % 1000;
    if(a == 1000)
      a = 0;
	printf("%d", a);
}


Compiler output:
main.c: In function 'main':
main.c:7:3: error: stray '\343' in program
    7 |   <U+3000>a = 1000 - n % 1000;
      |   ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int bills = n/1000;
    bils++;
    if(n%1000 == 0){
        cout << "0\n";
        return 0;
    }
    int bal = bills*1000 - n;
    cout << bal << "\n";
    return 0;
}

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

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

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

#include<stdio.h>
using namespace std;
int main(){
int n;
  cin>>n;
  n = n%1000;
  if(n<=500)
    cout<<n<<endl;
  else if(n>500)
    	cout<<1000-n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout<<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:14: error: 'endl' was not declared in this scope
    8 |     cout<<n<<endl;
      |              ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout<<1000-n<<endl;
      |         ^~~~
a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:23: error: 'endl' was not declared in this scope
   10 |         cout<<1000-n<<endl;
      |                       ^~~~
a.cc:10:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #inlude<iostream>
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout<<1000-a;
      |   ^~~~
a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner=new Scanner(System.in);
		int a=scanner.nextInt();
//		int b=scanner.nextInt();
		if(a%1000!=0) {
			System.out.println(1000-a%1000);

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


	}

}


Compiler output:
Main.java:8: error: cannot find symbol
		Scanner scanner=new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
		Scanner scanner=new Scanner(System.in);
		                    ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int yen;
  
    while(yen < N){
     
      yen += 1000;
      
    }
	
	if(yen == N){
     
      cout << 0;
      
    }else{
     
      cout << yen - N;
      
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'N' was not declared in this scope
   10 |     while(yen < N){
      |                 ^
a.cc:16:19: error: 'N' was not declared in this scope
   16 |         if(yen == N){
      |                   ^
Language: C++

#include<iostream>
int main(){int N;std::cin>>N;cout<<(10000-N)%1000;}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:30: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    2 | int main(){int N;std::cin>>N;cout<<(10000-N)%1000;}
      |                              ^~~~
      |                              std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
int main(){int N;std::cin>>N;cout<<(10000-N)%1000}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:30: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    2 | int main(){int N;std::cin>>N;cout<<(10000-N)%1000}
      |                              ^~~~
      |                              std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int p=N%1000;
  if(p>500)
    cout<<1000-p;
  else
    cout<<p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'N' was not declared in this scope
    7 |   int p=N%1000;
      |         ^
Language: Java


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

public class WeirdAlgorithm {


    public static void main(String[] args) {
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        System.out.println(1000-n%1000);
    }

    private static boolean ok(int k) {
        while (k>0) {
            int c = k%10;
            if (c!=4&&c!=7) return false;
            k/=10;
        }
        return true;
    }

    // 1 2 3 4 5 6
    // x * 2 == 10



    private static boolean preSum(int[] nums, int target) {
        int cur = 0;
        Set<Integer> set = new HashSet<>();
        set.add(0);
        for (int i = 0; i < nums.length; i++) {
            cur += nums[i];
            if (set.contains(cur-target)) {
                System.out.println(cur-target);
                return true;
            }
            set.add(cur);
        }
        return false;
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}


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

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

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

int(main)void{
  int N;
  
  scanf("%d",&N);
  
  printf("%d",N-1000*(N/1000));
  
  return 0;
}
  

Compiler output:
main.c:1:10: error: expected ';' before 'void'
    1 | int(main)void{
      |          ^~~~
      |          ;
main.c:1:14: error: expected identifier or '(' before '{' token
    1 | int(main)void{
      |              ^
Language: C

int(main)void{
  int N;
  printf("%d",N-1000*(N/1000));
  
  end;
}

Compiler output:
main.c:1:10: error: expected ';' before 'void'
    1 | int(main)void{
      |          ^~~~
      |          ;
main.c:1:14: error: expected identifier or '(' before '{' token
    1 | int(main)void{
      |              ^
Language: C++

#include <bits/stdc++.h>
#include <string.h>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15


int main(){

 ios_base::sync_with_studio(0);

  int Tests=1;
  //cin>>Tests;

  while(Tests--){
   int n;
   cin>>n;

    cout<<(1000-n%1000)%1000<<endl;
  }

return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'sync_with_studio' is not a member of 'std::ios_base'
   19 |  ios_base::sync_with_studio(0);
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define all(a) a.begin(),a.end()
#define f(i,l,u) for(ll i=l;i<u;i++)
#define lb lower_bound
#define ub upper_bound
ll fact[200001];

 long long power( long long x, 
                         ll y, ll p) 
{ 
    long long res = 1; // Initialize result 
  
    x = x % p; // Update x if it is more than or 
    // equal to p 
  
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
 long long modInverse( long long n, ll p) 
{ 
    return power(n, p - 2, p); 
} 
  
// Returns nCr % p using Fermat's little 
// theorem. 
 long long nCrModPFermat(long long n, 
                                 ll r, ll p) 
{ 
    // Base case 
    if (r == 0) 
        return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    
    
  
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
} 
  

void powe(ll p)
{
    fac[0] = 1; 
    for (int i = 1; i <= 200000; i++) 
        fac[i] = (fac[i - 1] * i) % p; 
    
}

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

Compiler output:
a.cc: In function 'long long int nCrModPFermat(long long int, long long int, long long int)':
a.cc:54:13: error: 'fac' was not declared in this scope; did you mean 'fact'?
   54 |     return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;
      |             ^~~
      |             fact
a.cc: In function 'void powe(long long int)':
a.cc:60:5: error: 'fac' was not declared in this scope; did you mean 'fact'?
   60 |     fac[0] = 1;
      |     ^~~
      |     fact
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define all(a) a.begin(),a.end()
#define f(i,l,u) for(ll i=l;i<u;i++)
#define lb lower_bound
#define ub upper_bound
ll fact[200001];

 long long power( long long x, 
                         ll y, ll p) 
{ 
    long long res = 1; // Initialize result 
  
    x = x % p; // Update x if it is more than or 
    // equal to p 
  
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
 long long modInverse( long long n, ll p) 
{ 
    return power(n, p - 2, p); 
} 
  
// Returns nCr % p using Fermat's little 
// theorem. 
 long long nCrModPFermat(long long n, 
                                 ll r, ll p) 
{ 
    // Base case 
    if (r == 0) 
        return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    
    
  
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
} 
  

void powe(ll mod)
{
    fac[0] = 1; 
    for (int i = 1; i <= 200000; i++) 
        fac[i] = (fac[i - 1] * i) % p; 
    
}

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

Compiler output:
a.cc: In function 'long long int nCrModPFermat(long long int, long long int, long long int)':
a.cc:54:13: error: 'fac' was not declared in this scope; did you mean 'fact'?
   54 |     return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;
      |             ^~~
      |             fact
a.cc: In function 'void powe(long long int)':
a.cc:60:5: error: 'fac' was not declared in this scope; did you mean 'fact'?
   60 |     fac[0] = 1;
      |     ^~~
      |     fact
a.cc:62:37: error: 'p' was not declared in this scope
   62 |         fac[i] = (fac[i - 1] * i) % p;
      |                                     ^
Language: C

#include <stidio.h>

int main(void){
    int price, change;
    scanf("%d", &price);
    if (price % 1000 == 0)
        change = 0;
    else 
        change = 1000 - (price % 1000);
    printf("%d\n", change);
    return 0;
}

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

#include <bits/stdc++.h>

int Main(){
int A;
	cin >> A;
    cout << 1000 - A;
}

Compiler output:
a.cc: In function 'int Main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >> A;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |     cout << 1000 - A;
      |     ^~~~
      |     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:1: warning: no return statement in function returning non-void [-Wreturn-type]
    7 | }
      | ^
Language: C++

#include<bis/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  if(n%1000==0)
    cout<<"0\n";
  else{
    int t=n%1000;
    cout<<1000-t<<"\n";
  }
  return 0;
}

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