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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a,w,t,r;
  a=0;w=0;t=0;r=0;
  cin >> n;
  vector<string>s(n);
  for(int i=0;i<n;i++){
    cin >> s(i);
  	if(s(i)=="AC"){
    	a++;
  	}else if(s(i)=="WA"){
    	w++;
  	}else if(s(i)=="TLE"){
    	t++;
  	}else{
    	r++
  	}
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
    9 |     cin >> s(i);
      |            ~^~~
a.cc:10:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   10 |         if(s(i)=="AC"){
      |            ~^~~
a.cc:12:19: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   12 |         }else if(s(i)=="WA"){
      |                  ~^~~
a.cc:14:19: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   14 |         }else if(s(i)=="TLE"){
      |                  ~^~~
a.cc:17:12: error: expected ';' before '}' token
   17 |         r++
      |            ^
      |            ;
   18 |         }
      |         ~
Language: C

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

#define ll long long
#define pb push_back

int main() {
    int n;
    cin >> n;
    int ost = n % 1000;
    if (ost == 0){
        cout << "0";
    } else {
        cout << 1000 - ost;
    }
}


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

#include<iostream>
using namespace std;

int main(){
int q,W;
  cin>>q;
  if(q%1000==0){
    W=0;
  }
  else{
   W=1000-(q%1000);
  }
  cout<<w;
}


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

#include<iostream>
using namespace std;

int main(){
int q,w;
  cin>>q;
  if(q%1000==0){
    W=0;
  }
  else{
   W=q%1000;
  }
  cout<<w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'W' was not declared in this scope
    8 |     W=0;
      |     ^
a.cc:11:4: error: 'W' was not declared in this scope
   11 |    W=q%1000;
      |    ^
Language: Java

import java.util.Scanner;

public class Payment {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int value = stdIn.nextInt();
        int change;

        if(value % 1000 == 0) {
            change = 0;
        }else {
            change = 1000 - (value % 1000);
        }

        System.out.println(change);
        stdIn.close();
    }

}

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: C++

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

int main()
  
{
  int n;cin>>n;
  int m = ceil(n/1000);
  int change = abs(m*1000 - n);
  
  cout<<change;
}

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

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

int main()
  
{
  int n;cin>>n;
  int m = ceil(n/1000);
  int change = abs(m*1000 - n);
  
  cout<<change<<endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: expected '}' at end of input
   11 |   cout<<change;
      |                ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#define PB push_back
#define FO(i,a,b) for (int i = a; i <= b; i++)
#define FOb(i,a,b) for(int i=b;i>=a;i--)
#define vi vector<int>
#define vulli vector<unsigned long long int>
using namespace std;
typedef unsigned long long int ulli;
void solve()
{ 
  ulli n,t=1000;
  cin >> n;
  while(t<n)
    t += 1000;
  cout << t-n;
}
  
  
}
int main()
{

    ulli t=1;
   // cin>>t;   
    while(t--){ solve(); cout<<"\n"; }
    return 0;
}

Compiler output:
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
int main()
{
   int i;
  cin>>i;
   cout<<1000-(i%1000);
}

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>>i;
      |   ^~~
      |   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:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |    cout<<1000-(i%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 <bits/stdc++.h>
using namespace std;

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

}


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

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

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

}

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

#include <iostream>
using namespace std;

int main(){
  int n;
  cin>>n;
  for(int i=1000;i<10000;1000+1000){
    if(n<i){
      int x=i;
      break;
    }
  }
  cout<<x-n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'x' was not declared in this scope
   13 |   cout<<x-n<<endl;
      |         ^
Language: C++

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

int main()
	{
  		int x,y;
		cin >> x;
		y = 1000-(x%1000)
		cout << y
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: expected ';' before 'cout'
   11 |                 y = 1000-(x%1000)
      |                                  ^
      |                                  ;
   12 |                 cout << y
      |                 ~~~~
Language: C++

#include<bits/stdc++h>
using namespace std;
int main(){
  long long n=0;
  cin>>n;
  cout<<min(n%1000, 1000-(n%1000))<<"\n";
  return 0;
}

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

    import java.util.Scanner;
     
    public class Main {
     
    	public static void main(String[] args) {
            Scanner scan = new Scanner(System.in);
            String price = scan.nextLine();
            scan.close();
     
            otsuri = Integer.parseInt(price) % 1000;
            if (otsuri == 0) {
                System.out.println(otsuri);
            } else {
                System.out.println(1000 - otsuri);
            }
        }
    }

Compiler output:
Main.java:10: error: cannot find symbol
            otsuri = Integer.parseInt(price) % 1000;
            ^
  symbol:   variable otsuri
  location: class Main
Main.java:11: error: cannot find symbol
            if (otsuri == 0) {
                ^
  symbol:   variable otsuri
  location: class Main
Main.java:12: error: cannot find symbol
                System.out.println(otsuri);
                                   ^
  symbol:   variable otsuri
  location: class Main
Main.java:14: error: cannot find symbol
                System.out.println(1000 - otsuri);
                                          ^
  symbol:   variable otsuri
  location: class Main
4 errors
Language: Java

import java.util.Scanner;

Scanner scan = new Scanner(System.in);
String str = scan.nextLine();

int price = Integer.parseInt(str);
System.out.println(price % 1000);

scan.close();


Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
Scanner scan = new Scanner(System.in);
^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
System.out.println(price % 1000);
^
Main.java:9: error: class, interface, enum, or record expected
scan.close();
^
3 errors
Language: Java

import java.util.Scanner;
 

    Scanner scan = new Scanner(System.in);
    String str = scan.nextLine();

    price = Integer.parseInt(str);
    System.out.println(price % 1000);

    scan.close();



Compiler output:
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
    Scanner scan = new Scanner(System.in);
    ^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
    price = Integer.parseInt(str);
    ^
Main.java:8: error: class, interface, enum, or record expected
    System.out.println(price % 1000);
    ^
Main.java:10: error: class, interface, enum, or record expected
    scan.close();
    ^
4 errors
Language: Java

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

        int N = sc.nextInt();
        
        int otsuri;
        if(N%1000==0)otsuri=0;
        else{
            int Amari = N%1000;
            otsuri = 1000-Amari;
        }
        System.out.println(otsuri);
    }
}

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

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


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

    A = N / 1000;
    B = N % 1000;

    if(B==0){
        cout << 0 << endl;
    }else{
        cout << (A + 1) * 1000 - N << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'A' was not declared in this scope
    9 |     A = N / 1000;
      |     ^
a.cc:10:5: error: 'B' was not declared in this scope
   10 |     B = N % 1000;
      |     ^
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();
		System.out.println(((n+999)/1000)*1000 - n);
	}

}



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: C++

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

int main(){
  int n;
  cin >> n;
  int t=1000;
  while(t-n<0){
    t=t+1000
  }
  cout << t-n << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before '}' token
    9 |     t=t+1000
      |             ^
      |             ;
   10 |   }
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'else' without a previous 'if'
    9 |         else cout<<0<<endl;}
      |         ^~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

static const string STATUS_TYPE[] = ["AC", "WA", "TLE", "RE"];

int main(void) {
    const int MAX_STATUS_COUNT = 4;
    
    int input_count = 0;
  	cin >> input_count;
    
    string input;
    int results[MAX_STATUS_COUNT] = {};
    for (int i = 0; i < input_count; ++i) {
		cin >> input;
        for (int j = 0; j < MAX_STATUS_COUNT; ++j) {
            if (STATUS_TYPE[j] == input) {
                ++results[i];
            }
        }
    }
    
    for (int i = 0; i < MAX_STATUS_COUNT; ++i) {
   		cout << STATUS_TYPE[i] + " x " << results[i]  << endl;
    }

    return 0;
}


Compiler output:
a.cc:6:38: error: expected identifier before string constant
    6 | static const string STATUS_TYPE[] = ["AC", "WA", "TLE", "RE"];
      |                                      ^~~~
a.cc:6:42: error: expected ']' before ',' token
    6 | static const string STATUS_TYPE[] = ["AC", "WA", "TLE", "RE"];
      |                                          ^
      |                                          ]
a.cc: In lambda function:
a.cc:6:42: error: expected '{' before ',' token
a.cc: At global scope:
a.cc:6:37: error: initializer fails to determine size of 'STATUS_TYPE'
    6 | static const string STATUS_TYPE[] = ["AC", "WA", "TLE", "RE"];
      |                                     ^~~~~
a.cc:6:37: error: array must be initialized with a brace-enclosed initializer
a.cc:6:44: error: expected unqualified-id before string constant
    6 | static const string STATUS_TYPE[] = ["AC", "WA", "TLE", "RE"];
      |                                            ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: lvalue required as left operand of assignment
    9 |   if(N%1000=0){r=0;}
      |      ~^~~~~
Language: C++

#include <iostream>

using namespace std;

void main(void) {
    static const unsigned int unit = 1000;

    unsigned int price = 0;
    cin >> price;

    unsigned int temp = price;
    while (temp > unit) {
        temp -= unit;
    }
    const unsigned int change = temp;

    cout << change << endl;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main(void) {
      | ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: lvalue required as left operand of assignment
    9 |   if(N%1000=0){r=0;}
      |      ~^~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
    9 |   if(N=1000){r=0};
      |                 ^
      |                 ;
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else r=N%1000;
      |   ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
    9 |   if(N=1000){r=0}
      |                 ^
      |                 ;
Language: C++

#include <iostream>
using namespace std;

static const unsigned int unit = 1000;

unsigned int price = 0;
cin >> price;

unsigned int temp = price;
while (temp > unit) {
    temp -= unit;
}
const unsigned int change = temp;

cout << change << endl;


Compiler output:
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> price;
      | ^~~
a.cc:10:1: error: expected unqualified-id before 'while'
   10 | while (temp > unit) {
      | ^~~~~
a.cc:15:1: error: 'cout' does not name a type
   15 | cout << change << endl;
      | ^~~~
Language: C++

#include <iostream>

static const unsigned int unit = 1000;

unsigned int price = 0;
std::cin >> price;

unsigned int temp = price;
while (temp > unit) {
    temp -= unit;
}
const unsigned int change = temp;

std::cout << change << std::endl;


Compiler output:
a.cc:6:6: error: 'cin' in namespace 'std' does not name a type
    6 | std::cin >> price;
      |      ^~~
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:9:1: error: expected unqualified-id before 'while'
    9 | while (temp > unit) {
      | ^~~~~
a.cc:14:6: error: 'cout' in namespace 'std' does not name a type
   14 | std::cout << change << std::endl;
      |      ^~~~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

static const unsigned int unit = 1000;

unsigned int price = 0;
std::cin >> price;

unsigned int temp = price;
while (temp > unit) {
    temp -= unit;
}
const unsigned int change = temp;

std::cout << change << std::endl;

Compiler output:
a.cc:4:6: error: 'cin' in namespace 'std' does not name a type
    4 | std::cin >> price;
      |      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | static const unsigned int unit = 1000;
a.cc:7:1: error: expected unqualified-id before 'while'
    7 | while (temp > unit) {
      | ^~~~~
a.cc:12:6: error: 'cout' in namespace 'std' does not name a type
   12 | std::cout << change << std::endl;
      |      ^~~~
a.cc:12:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   12 | std::cout << change << std::endl;
      | ^~~
Language: C++

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

int main() { 
  int N;
  cin >> N;
  a = 1000 - N % 1000;
  if (a == 1000) a = 0;
  cout << a << endl;
}


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
public class video
{   
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; 		
		 } 	
	 }
	
	 public static void main(String[] args){
		 FastReader scan=new FastReader();
		 int t = scan.nextInt();
		 System.out.println(1000 - t%1000);
	} 
} 


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:63: error: expected '}' at end of input
    4 |   int n;cin>>n;int x=1000-n%1000;if(x==1000)x=0;cout<<x<<endl;
      |                                                               ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include<stdio.h>
int main(void)
{
    int a=1000,N,i,b,j=1000;
    scanf("%d",&N);
    if(N>=1 && N=<10000)
    {
    
    for(i=1;j<N;i++)
    {
        j=j+1000;
    }
    b=j-N;
    if(b==0)
        printf("0\nWe can pay the exact price.");
       else
            printf("%d\nWe will use %d 1000-yen bills to pay the price and receive %d yen in change.",b,i,b);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:18: error: expected expression before '<' token
    6 |     if(N>=1 && N=<10000)
      |                  ^
Language: C

#include<stdio.h>
 
int main(void)
{
  int N;
  int x;
  scanf("%d",&N);
  
  while( N >= 1000 )
  {
    N-=1000:
  }
    
  
  
  printf("%d\n",N);
  
}

Compiler output:
main.c: In function 'main':
main.c:11:12: error: expected ';' before ':' token
   11 |     N-=1000:
      |            ^
      |            ;
Language: C

#include<stdio.h>
 
int main(void)
{
  int N;
  int x;
  scanf("%d",&N);
  
  while( N > 1000 )
  {
    N-=1000:
  }
    
  
  
  printf("%d\n",&N);
  
}

Compiler output:
main.c: In function 'main':
main.c:11:12: error: expected ';' before ':' token
   11 |     N-=1000:
      |            ^
      |            ;
Language: C

#include<stdio.h>
 
int main(void)
{
  int N;
  int x;
  scanf("%d",&N);
  
  while( N > 1000 )
  {
    N-=1000:
  }
    
  
  
  printf("%d\n",N);
  
}

Compiler output:
main.c: In function 'main':
main.c:11:12: error: expected ';' before ':' token
   11 |     N-=1000:
      |            ^
      |            ;
Language: Java

import java.until.Scanner;

public class 173a {
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextLine();
    int x = (n+1000-1)/1000;
    int ans = x*1000 - n;
    System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: <identifier> expected
public class 173a {
            ^
1 error
Language: Java

import java.until.Scanner;

public class 173_a {
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextLine();
    int x = (n+1000-1)/1000;
    int ans = x*1000 - n;
    System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: illegal underscore
public class 173_a {
                ^
1 error
Language: Java

import java.util.*;

public class 173_A_1 {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());

        // 主処理
        while (0 < n) {
            n -= 1000;
        }
        int result = Math.abs(n);

        // 出力
        System.out.println(result);
    }
}


Compiler output:
Main.java:3: error: illegal underscore
public class 173_A_1 {
                ^
1 error
Language: Java

import java.util.*;

public class 173_A_1 {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        while (0 < n) {
            n -= 1000;
        }
        int result = Math.abs(n);

        // 出力
        System.out.println(result);
    }
}


Compiler output:
Main.java:3: error: illegal underscore
public class 173_A_1 {
                ^
1 error
Language: Java

public class at173_a {
  public static void main(String args[]){
    int n = 10;
    cin >> n;
    int x = (n+1000-1)/1000;
    int ans = x*1000 - n;
    System.out.println(ans);
  }
}


Compiler output:
Main.java:4: error: not a statement
    cin >> n;
        ^
1 error
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |   cout<<min((1000-(n%1000),(n%1000))<<endl;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

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

 return 0;
}

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

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

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

    while (true) {
        if (m < 1000) {
            cout << 1000-m;
            return;
        }
        m-=1000;
    }
}


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

#include <iostream>

using namespace std;

int change(int price) {
  if (price % 1000 == 0) {
    return 0;
  }
  return 1000 - price % 1000; 

int main() {
  int price;
  cin >> price;
  cout << change(price);
}

Compiler output:
a.cc: In function 'int change(int)':
a.cc:11:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   11 | int main() {
      |         ^~
a.cc:11:9: note: remove parentheses to default-initialize a variable
   11 | int main() {
      |         ^~
      |         --
a.cc:11:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:12: error: a function-definition is not allowed here before '{' token
   11 | int main() {
      |            ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:5:23: note: to match this '{'
    5 | int change(int price) {
      |                       ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  int t = 1000;
  while( t < n) t += 1000;
  cout << t - n <<< endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected primary-expression before '<' token
    9 |   cout << t - n <<< endl;
      |                   ^
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner();
        Integer price = sc.nextInt();

        system.out.println(price % 10000);
    }
}

Compiler output:
Main.java:5: error: no suitable constructor found for Scanner(no arguments)
        Scanner sc = new Scanner();
                     ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
Main.java:8: error: package system does not exist
        system.out.println(price % 10000);
              ^
2 errors
Language: Java

import java.util.Scanner;
import java.lang.*;

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

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

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    while(n > 1000){
      n = n - 1000;
  }
    int ans = 1000 - n;
    System.out.println(ans);
  
}

Compiler output:
Main.java:14: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;

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

Compiler output:
Main.java:14: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

int main() {
	int n;
	cin >> n;
	ll V = 0, E = 0;
	rep(i,n) V += ll(i+1)*(n-i);
	rep(i,n-1) {
		int a, b;
		cin >> a >> b;
		if (a > b) swap(a,b);
		E += ll(a)*(n - b + 1);
	}
	cout << V - E << endl>;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: expected primary-expression before ';' token
   18 |         cout << V - E << endl>;
      |                               ^
Language: C++

#include <bits/stdc++.h>
 
int main() {
    int n,a;cin >> n;
    a=1000-(n-1)%1000-1;    
    cout << a << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     int n,a;cin >> n;
      |             ^~~
      |             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 << a << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |     cout << a << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

class Main
{
  public:
  	int p()
    {
      int pay;
      scanf("%d",&pay);
      return (pay%1000);
    }
};

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;

class Payment
{
  public:
  	int p()
    {
      int pay;
      scanf("%d",&pay);
      return (pay%1000);
    }
};

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace as std;

class Payment
{
  public:
  	int p()
    {
      int pay;
      scanf("%d",&pay);
      return (pay%1000);
    }
}

Compiler output:
a.cc:2:17: error: 'as' is not a namespace-name
    2 | using namespace as std;
      |                 ^~
a.cc:2:19: error: expected ';' before 'std'
    2 | using namespace as std;
      |                   ^~~~
      |                   ;
a.cc:2:20: error: 'std' does not name a type
    2 | using namespace as std;
      |                    ^~~
a.cc:13:2: error: expected ';' after class definition
   13 | }
      |  ^
      |  ;
Language: C++

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

int main(){
  int N; cin >> N;
  int Order = (int)(N/1000)*1000
  if(Order > N)
    cout << Order - N << endl;
  else
    cout << N - Order << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'if'
    7 |   if(Order > N)
      |   ^~
a.cc:9:3: error: 'else' without a previous 'if'
    9 |   else
      |   ^~~~
Language: C++

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    val answer = if (n % 1000 == 0) 0 else (1000 - n % 1000);
    println(answer)
}

Compiler output:
a.cc:1:1: error: 'fun' does not name a type
    1 | fun main(args: Array<String>) {
      | ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected ';' before '}' token
   12 |         change = 0
      |                   ^
      |                   ;
   13 |   }
      |   ~
Language: Java

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

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


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

#include <iostream>
using namespace std;

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

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:6:37: error: expected ';' before '}' token
    6 |   cout << (1000 - (n % 1000) % 1000)
      |                                     ^
      |                                     ;
    7 | }
      | ~
Language: Java

import java.util.*;

public class Solution {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int rem = N % 1000;
    System.out.println(rem == 0 ? 0 : 1000 - rem);
  }
}

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

#include math
int main(){
  int a;
  scanf("%d",&a);
  printf(%d,1000-a);
  
}

Compiler output:
main.c:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include math
      |          ^~~~
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&a);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include math
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&a);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |   printf(%d,1000-a);
      |   ^~~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:10: error: expected expression before '%' token
    5 |   printf(%d,1000-a);
      |          ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d",&a);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d",&a);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    4 |   printf(%d,1000-a);
      |   ^~~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:10: error: expected expression before '%' token
    4 |   printf(%d,1000-a);
      |          ^
Language: C

int main(){

int a;
scanf(%d,&a);
printf(%d,1000-a);
  
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf(%d,&a);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf(%d,&a);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:7: error: expected expression before '%' token
    4 | scanf(%d,&a);
      |       ^
main.c:5:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 | printf(%d,1000-a);
      | ^~~~~~
main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:8: error: expected expression before '%' token
    5 | printf(%d,1000-a);
      |        ^
Language: C

# include <stdio.h>
 
int main (void)
{
  int a;
  int b;
  int c;
  
  printf("input manny>>>");
  scanf("%d", &a);
  
  b = a % 1000;
  c = 1000 - b
  printf("%d\n", b);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:15: error: expected ';' before 'printf'
   13 |   c = 1000 - b
      |               ^
      |               ;
   14 |   printf("%d\n", b);
      |   ~~~~~~
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();
		if(n%1000==0)System.out.println("0");
		else System.out.println(1000-n%1000);
	}

}


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: C

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<tuple>
#include<ctime>
#include<functional>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p; 
#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))

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

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

/* author : akshatjai258 */

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

typedef pair<string, string> pss;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef vector<pii> vii;

typedef vector<ll> vl;

typedef vector<vl> vvl;

#define mod int(1e9 + 7)

#define inf int(1e9)

#define endl "\n"

#define rep(i, n) for (int(i) = (0); (i) < (n); ++(i))

#define fi first

#define mem0(a) memset(a, 0, sizeof(a))

#define mem1(a) memset(a, -1, sizeof(a))

#define memf(a) memset(a, false, sizeof(a))

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

#define se second

#define mp make_pair

#define pb push_back

#define w(x)  \

	int x;    \	cin >> x; \

	while (x--)

#define ps(x, y) fixed << setprecision(y) << x

void prep()

{

	ios_base::sync_with_stdio(0);

	cin.tie(0);

	cout.tie(0);

	/*#ifndef ONLINE_JUDGE

	freopen("input.txt", "r", stdin);

	freopen("output.txt", "w", stdout);

#endif*/

}

int main()

{

	prep();
  	int n;
  	cin>>n;
  	if(n%1000)
    {
      cout<<1000-(n%1000);
    }
  	else{
      cout<<0<<endl;
      }

	return 0;

}

Compiler output:
a.cc:51:19: error: stray '\' in program
   51 |         int x;    \     cin >> x; \
      |                   ^
a.cc:51:25: error: 'cin' does not name a type
   51 |         int x;    \     cin >> x; \
      |                         ^~~
a.cc:53:9: error: expected unqualified-id before 'while'
   53 |         while (x--)
      |         ^~~~~
a.cc: In function 'int main()':
a.cc:81:9: error: 'prep' was not declared in this scope; did you mean 'rep'?
   81 |         prep();
      |         ^~~~
      |         rep
Language: Java

//'main' method must be in a class 'Rextester'.
//openjdk version '11.0.5' 

import java.util.*;
import java.lang.*;

public class Main
{  
    public static void main(String args[])
    {
        Scanner s = new Scanner(System.in);
      int x =s.nextInt();
      if(x%1000==0)
        System.out.println(x%1000);
      else{
      System.out.println(1000-x%1000)
      }
    }
}

Compiler output:
Main.java:16: error: ';' expected
      System.out.println(1000-x%1000)
                                     ^
1 error
Language: Java

//'main' method must be in a class 'Rextester'.
//openjdk version '11.0.5' 

import java.util.*;
import java.lang.*;

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

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

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll n,m,k;
char a[6][6];
bool check(ll r,ll c)
{
  ll cont=0;
  for(ll i=0;i<n;i++)
    for(ll j=0;j<m;j++)
    {
      if(1&(1<<i) || 1&(1<<j))
        continue;
      else
        if(a[i][j]=='#')
          cont++;
    }
  if(cont==k)
    return true;
  else
    return false;
}
int main()
{
  
  cin>>n>>m>>k;
  for(ll i=0;i<n;i++)
  {
    for(ll j=0;j<m;j++)
    {
      cin>>a[i][j];
    }
  }
  ll ans=0;
  for(ll i=0;i<(1<<n);i++)
  {
    for(l j=0;j<(1<<m);j++)
    {
      if(check(i,j))
        ans++;
    }
  }
  cout<<ans<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'l' was not declared in this scope
   37 |     for(l j=0;j<(1<<m);j++)
      |         ^
a.cc:37:15: error: 'j' was not declared in this scope
   37 |     for(l j=0;j<(1<<m);j++)
      |               ^
Language: C++

#include<iostream>
using namespace std;

int main()	{
  int n;
  cout << (n%1000)?(1000-n%1000):0 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:36: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |   cout << (n%1000)?(1000-n%1000):0 << endl;
      |                                  ~~^~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:9:11: error: expected ';' before '}' token
    9 |   return 0
      |           ^
      |           ;
   10 | }
      | ~
Language: C++

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;
int main()
{
  ll n;
  cin>>n;
  ll ans=ceil(1.0*n/1000);
  ans=ans*1000;
  ans=ans-n;
  cout<<ans
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before 'return'
   11 |   cout<<ans
      |            ^
      |            ;
   12 |   return 0;
      |   ~~~~~~
Language: C++

//#pragma GCC optimize "trapv"
//-D_GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define ii pair<int,int>
#define Max 100000+5
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f first
#define s second
#define pb push_back
int mod = 1000000007;
int mod1 = 998244353;
vector<int> g[Max];
bool vis[Max];
int d, x, y;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
void ex(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        ex(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}


void dfs(int u){

	vis[u]=1;
	for(int i=0;i<g[u].size();i++){
		int v=g[u][i];
		if(vis[v]!=1)
			dfs(v);
	}
}



int power(int a,int b){
    if(b==1)return a;
    if(a>mod)a%=mod;
    int r=1;
    while(b){
        if(b&1)r=r%mod*a%mod;
        a=a%mod*a%mod;
        b/=2;
    }
    return r;
}
class uf{
    vector<int> v;
    vector<int> sz;
    
    
    public :
    uf(int n){
        v.resize(n+1);
        iota(v.begin()+1,v.end(),1);
        sz.resize(n+1,1);
        //1 to sz
    }
    int root(int b){
        while(v[b]!=b){
            b = v[b];
        }   
        return b;
    }
    void u(int a, int b){
        //combine a and b
        
        int ra=root(a);
        int rb=root(b);
        if(ra==rb)return ;
        if(sz[ra]<sz[rb]){
            v[ra] = v[rb];
            sz[rb]+=sz[ra];
        }else{
            v[rb]=v[ra];
            sz[ra]+=sz[rb];
        }
    }
    bool f(int a,int b){
        //same set
        return (root(a)==root(b));
    }
   
    
};
vector<int> matmul(vector<int> a,vector<int> b){
    vector<int> c(4,0);
    c[0] = (a[0]%mod*b[0]%mod + a[1]%mod*b[2]%mod)%mod;
    c[1] = (a[0]%mod*b[1]%mod + a[1]%mod*b[3]%mod)%mod;
    c[2] = (a[2]%mod*b[0]%mod + a[3]%mod*b[2]%mod)%mod;
    c[3] = (a[2]%mod*b[1]%mod + a[3]%mod*b[3]%mod)%mod;
    return c;
}
vector<int> id={1,0,0,1};

int32_t main(){
	IO
	//freopen("input.txt","r",stdin);
    	//freopen("output.txt","w",stdout);
	int n;
  	cin>>n;
  	cout<<(n - 1000*((n+999)/1000);
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:116:39: error: expected ')' before ';' token
  116 |         cout<<(n - 1000*((n+999)/1000);
      |               ~                       ^
      |                                       )
Language: C

#include <stdio.h>

int main(void) {
	int N;
	scanf("%d",&N);
	n=(1000-n%1000)-1000;
	return 0;
}


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

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

	int val=n%1000;
	IF(val==0)
	{
		cout<<0<<endl;;
	}
	else
	{
		cout<<1000-val<<endl;
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'IF' was not declared in this scope
    9 |         IF(val==0)
      |         ^~
a.cc:13:9: error: 'else' without a previous 'if'
   13 |         else
      |         ^~~~