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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: expected ';' before ')' token
    6 |   cout << ( 1000 - N % 1000 ) % 1000) << endl;
      |                                     ^
      |                                     ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: expected ';' before ')' token
    6 |   cout << ( 1000 - N % 1000 ) % 1000 ) << endl;
      |                                     ^~
      |                                     ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:37: error: expected ';' before ')' token
    6 |   cout << ( 1000 - N & 1000 ) % 1000 ) << endl;
      |                                     ^~
      |                                     ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string N;
  cin >> N;
  string M ==
  int O = atoi(N.c_str());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected initializer before '==' token
    6 |   string M ==
      |            ^~
Language: C++

#include <iostream>
using namespace std;

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

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

#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> N ;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:10: error: expected ';' before '}' token
   11 |     K = 0
      |          ^
      |          ;
   12 |   }
      |   ~       
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout << K << 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:17:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout << K << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

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


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

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


Compiler output:
Main.java:18: error: class, interface, enum, or record expected
import java.util.*; 
^
1 error
Language: Java

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

Compiler output:
Main.java:9: error: cannot find symbol
        ans=0;
        ^
  symbol:   variable ans
  location: class Main
Main.java:15: error: cannot find symbol
    	System.out.println(ans);
    	                   ^
  symbol:   variable ans
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int c0 = 0;
  int c1 = 0;  
  int c2 = 0;
  int c3 = 0;
  for (int i = 0; i < n; i++){
    String S;
    cin >> S;
    if (S == "AC"){
      c0 += 1
    }else if (S == "WA"){
      c1 += 1
    }else if (S == "TLE"){
      c2 += 1
    }else if (S == "RE"){
      c3 += 1
    }
  }
  cout << "AC" << " " << "x" << " " << c0 << endl;
  cout << "WA" << " " << "x" << " " << c1 << endl;
  cout << "TLE" << " " << "x" << " " << c2 << endl;
  cout << "RE" << " " << "x" << " " << c3 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'String' was not declared in this scope
   11 |     String S;
      |     ^~~~~~
a.cc:12:12: error: 'S' was not declared in this scope
   12 |     cin >> S;
      |            ^
a.cc:14:14: error: expected ';' before '}' token
   14 |       c0 += 1
      |              ^
      |              ;
   15 |     }else if (S == "WA"){
      |     ~         
a.cc:16:14: error: expected ';' before '}' token
   16 |       c1 += 1
      |              ^
      |              ;
   17 |     }else if (S == "TLE"){
      |     ~         
a.cc:18:14: error: expected ';' before '}' token
   18 |       c2 += 1
      |              ^
      |              ;
   19 |     }else if (S == "RE"){
      |     ~         
a.cc:20:14: error: expected ';' before '}' token
   20 |       c3 += 1
      |              ^
      |              ;
   21 |     }
      |     ~
Language: C++

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclide; did you mean #include?
    1 | #inclide <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 | #inclide <iostream>
a.cc:7:5: error: 'cout' was not declared in this scope
    7 |     cout<<"0"<<endl;
      |     ^~~~
a.cc:7:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:16: error: 'endl' was not declared in this scope
    7 |     cout<<"0"<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclide <iostream>
a.cc:8:8: error: 'cout' was not declared in this scope
    8 |   else cout<<1000-N%1000<<endl;
      |        ^~~~
a.cc:8:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:27: error: 'endl' was not declared in this scope
    8 |   else cout<<1000-N%1000<<endl;
      |                           ^~~~
a.cc:8:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
int swap(int&a , int&b){
int temp = a;
a = b;
b = temp;

}
int countDivisors(int n)
{
    int cnt = 0;
    for (int i = 1; i <= sqrt(n); i++) {
        if (n % i == 0) {
            // If divisors are equal,
            // count only one
            if (n / i == i)
                cnt++;

            else // Otherwise count both
                cnt = cnt + 2;
        }
    }
    return cnt;
}
int main() {
    int n = 0;
    cin >> n;
  if (n >= 1000){
    cout << 1000 - n%1000;
  }else{
    cout << n ;
	return 0;
}


Compiler output:
a.cc: In function 'int swap(int&, int&)':
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^
a.cc: In function 'int main()':
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:28:12: note: to match this '{'
   28 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>

std::vector<int> onesIndex(int n) {
	std::vector<int> ret;

	for (int k = 0; n != 0; ++k) {
		if (n % 2 == 1) {
			ret.push_back(k);
		}
		n = n / 2;
	}

	return ret;
}

int main() {
	int h, w, k;
	std::cin >> h >> w >> k;
	std::vector<std::vector<char>> grid;
	std::vector<int> rowSum(h);
	std::vector<int> heightSum(w);
	int t = 0;
	for (int i = 0; i < h; ++i) {
		std::string s;
		std::cin >> s;
		std::vector<char> v;
		for (int j = 0; j < w; ++j) {
			v.push_back(s[j]);
			if (s[j] == '#') {
				rowSum[i] += 1;
				heightSum[j] += 1;
				t += 1;
			}
		}
		grid.push_back(v);
	}

	int num = 0;
	for (int i = 0; i < pow(2,h); ++i) {
		for (int j = 0; j < pow(2,w); ++j) {
			int sum = 0;
			for (auto y : onesIndex(i)) {
				for (auto x : onesIndex(j)) {
					if (grid[y][x] == '#') {
						sum -= 1;
					}
				}
				sum += rowSum[y];
			}
			for (auto x : onesIndex(j)) {
				sum += heightSum[x];
			}

			if (t - sum == k) {
				num += 1;
			}
		}
	}

	std::cout << "sum:" << num << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:29: error: 'pow' was not declared in this scope
   42 |         for (int i = 0; i < pow(2,h); ++i) {
      |                             ^~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    int N; cin>>N;
    vector<int>Arr(N,0); int tmp;
    for(int i=0; i<N; i++){
        cin>>tmp;
        Arr[i]=tmp;
    }
    sort(Arr.begin(),Arr.end());
    int profit=0; int tmp;
    for(int i=1; i<N; i++){
      tmp=i/2; profit+=Arr[N-1-tmp];
    }
    cout<<profit<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: redeclaration of 'int tmp'
   15 |     int profit=0; int tmp;
      |                       ^~~
a.cc:9:30: note: 'int tmp' previously declared here
    9 |     vector<int>Arr(N,0); int tmp;
      |                              ^~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N; cin>>N;
    vector<int>Arr(N,0); int tmp;
    for(int i=0; i<N; i++){
        cin>>tmp;
        Arr[i]=tmp;
    }
    sort(Arr.begin(),Arr.end());
    int profit=0; int tmp;
    for(int i=1; i<N; i++){
      tmp=i/2; profit+=Arr[tmp];
    }
    cout<<profit<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: redeclaration of 'int tmp'
   15 |     int profit=0; int tmp;
      |                       ^~~
a.cc:9:30: note: 'int tmp' previously declared here
    9 |     vector<int>Arr(N,0); int tmp;
      |                              ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   cout << 1000 -= N << endl;
      |                   ~~^~~~~~~
Language: C++

//	Id:lys2002
//	Time:2020/8/7 15:24
#include<bits/stdc++.h>
using namespace std;

#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)

typedef double db;
typedef long long ll;

const ll md=1000000007;

inline void Fio(){
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin>>N;
    N%=1000;
    cout<<(1000-n)%1000<<endl;
    return 0;
  }


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

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

int main(){
int n; cin>>n;
cout<<(1000-n+n/1000*1000)<<endl;
return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ';' before '}' token
    7 | return 0
      |         ^
      |         ;
    8 | }
      | ~
Language: C++

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nemespace'
    2 | using nemespace std;
      |       ^~~~~~~~~
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:7:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   if(n%1000==0) cout<<"0";
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   else cout<<1000-n%1000;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

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

inline int D(){
    int t ;
    scanf( "%d" , &t ) ;
    return t ;
}
inline ll LLD(){
    ll t ;
    scanf( "%lld" , &t ) ;
    return t ;
}
//const int INF = 0x3f3f3f3f;
//const int mod=1e9+7;
//const double pi=3.14159265359;
//###################################################################
int main() {
         int n=D();
         if(n%1000==0)puts("0");
         else
             cout<<1000-(n%1000);

}

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

public class Main {
  import java.util.Scanner;
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int N =sc.nextInt();
			int count = 0;
			int count2 = 0;
			int count3= 0;
			int count4 = 0;
		for(int i = 0;i < N;i++) {
			String H = sc.next();
			if(H.equals("AC")) {
				count++;
			}
			else if(H.equals("WA")) {
				count2++;
			}
			else if(H.equals("TLE")) {
				count3++;
			}
			else if(H.equals("RE")) {
				count4++;
			}
		}
		System.out.println("AC  x  " + count);
		System.out.println("WA  x  " + count2);
		System.out.println("TLE  x  " + count3);
		System.out.println("RE  x  " + count4);
	}
}

Compiler output:
Main.java:2: error: illegal start of type
  import java.util.Scanner;
  ^
Main.java:2: error: <identifier> expected
  import java.util.Scanner;
                          ^
2 errors
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:7:28: error: expected ';' before 'return'
    7 |   printf("%d\n",money-1000)
      |                            ^
      |                            ;
    8 | return 0;
      | ~~~~~~
Language: Java

package game;

import java.util.Scanner;

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

}

Compiler output:
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:19: error: class, interface, enum, or record expected
}
^
Main.java:1: error: unnamed class should not have package declaration
package game;
^
3 errors
Language: Java

package game;

import java.util.Scanner;

public class test {

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

}

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

package game;

import java.util.Scanner;

public class test {

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

}

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: 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:6:22: error: expected ';' before 'return'
    6 | printf("%d\n",n%1000)
      |                      ^
      |                      ;
    7 | return 0;
      | ~~~~~~
Language: Java

import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println((1000 - (n % 1000)) % 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>

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

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>>amount;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         cout<<amount%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;
  int x = (n + 1000 - 1) / 1000
  int ans = x * 1000 - n;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'int'
    8 |   int ans = x * 1000 - n;
      |   ^~~
a.cc:9:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

def solve():
    n = int(input())
    print((1000 - n%1000)%1000)
if __name__=='__main__':
    solve()

Compiler output:
a.cc:4:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    4 | if __name__=='__main__':
      |              ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def solve():
      | ^~~
Language: C++

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

using namespace std;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  
  int n, k;
  cin >> n >> k;
  
  int zero = 0;
  vector<int> pos, neg;
  pos.resize(n);
  neg.resize(n);
  
  for (int i = 0, x; i < n; i++)
  {
	cin >> x;
	if (x < 0) neg.push_back(x);
	else if (x > 0) pos.push_back(-x);
	else zero++;
  }
  
  if (zero >= k)
  {
	cout << "0";
	return 0;
  }
  
  sort(pos.begin(), pos.end());
  sort(neg.begin(), neg.end());
  
  long long int prod = 1;
  while (k >= 2)
  {
	n = neg.size() >= 2 ? 0 : *(neg.end() - 1) * *(neg.end() - 2);
	p = pos.size() >= 2 ? 0 : *(pos.end() - 1) * *(pos.end() - 2);
	
	if (p >= n)
	{
	  prod *= p;
	  pos.pop_back();
	  pos.pop_back();
	}
	else
	{
	  prod *= n;
	  neg.pop_back();
	  neg.pop_back();
	}
	k -= 2;
	if (prod > (1 << 42)) prod %= 10e9 + 7;
  }
  
  if (k != 0 && !pos.empty())
  {
	prod *= *(pos.end() - 1);
  }
  prod %= 10e9 + 7;
  cout << prod;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'p' was not declared in this scope
   42 |         p = pos.size() >= 2 ? 0 : *(pos.end() - 1) * *(pos.end() - 2);
      |         ^
a.cc:57:23: warning: left shift count >= width of type [-Wshift-count-overflow]
   57 |         if (prod > (1 << 42)) prod %= 10e9 + 7;
      |                     ~~^~~~~
a.cc:57:36: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   57 |         if (prod > (1 << 42)) prod %= 10e9 + 7;
      |                               ~~~~~^~~~~~~~~~~
a.cc:57:36: note:   in evaluation of 'operator%=(long long int, double)'
a.cc:64:8: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   64 |   prod %= 10e9 + 7;
      |   ~~~~~^~~~~~~~~~~
a.cc:64:8: note:   in evaluation of 'operator%=(long long int, double)'
Language: C++

#include<iostream>

int main(){
	int amount;
  	cin>>amount;
    cout<<amount%1000<<endl;
}

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>>amount;
      |         ^~~
      |         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:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |     cout<<amount%1000<<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:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |     cout<<amount%1000<<endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected ';' before 'return'
    7 |   cout<<(1000-(n%1000))%1000
      |                             ^
      |                             ;
    8 | 
    9 |     return 0;
      |     ~~~~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected '}' before 'else'
   12 |         else{
      |         ^~~~
a.cc:11:7: note: to match this '{'
   11 |       {
      |       ^
a.cc:12:9: error: expected '}' before 'else'
   12 |         else{
      |         ^~~~
a.cc:9:18: note: to match this '{'
    9 |     if(n/1000==0){
      |                  ^
Language: Java

import java.util.Scanner;

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

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

    }
}


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>
using namespace std;

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

	if (N < 1000) {
		num_of_K_sheet = 1;
		ans = 1000 - N;
	} else {
		num_of_K_sheet = N / 1000 + 1;
		ans = 1000 * num_of_K_sheet - N;
	}

	cout << ans << endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before 'cout'
    9 |   else(N < 1000 && N > 1)
      |                          ^
      |                          ;
   10 |     cout << 1000 - N;
      |     ~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N,x;
  cout <<"N:";
  cin >> N;
  x = 1000 - N;
  
  cout << N;

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

#include <stdio.h>

int main(void)
{
	int N, amari, ans;

	scanf_s("%d", &N);

	amari = N % 1000;
	if (amari == 0) ans = 0;
	else ans = 1000 - amari;
	
	printf("%d", ans);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
using namespace std;

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

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

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

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

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

#include <iostream>
 using namespace std;
 int main(){
 int N;
 cin >> N;
 cout << (1000 - N % 1000) % 1000 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:43: error: expected '}' at end of input
    6 |  cout << (1000 - N % 1000) % 1000 << endl;
      |                                           ^
a.cc:3:12: note: to match this '{'
    3 |  int main(){
      |            ^
Language: C++

#include <iostream>
2 using namespace std;
3 int main(){
4 int N;
5 cin >> N;
6 cout << (1000 - N % 1000) << endl;

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2 using namespace std;
      | ^
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3 int main(){
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Apayment {

	public static void main(String[] args) {
	    // 1000の倍数の場合はお釣りは必ず0円となる
	    // 1000の倍数でない場合は、1000-（N円の1の位～百の位）がお釣りとなる
	    int answer = 0;
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    try{
	        String str = br.readLine();
	        int n = Integer.parseInt(str);

	        if (n % 1000 != 0) {
	            System.out.println(answer);
	        } else {
	            answer = 1000 - (n % 1000);
	            System.out.println(answer);
	        }

	    } catch (IOException ioe) {

	    }
	}

}


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

	public static void main(String[] args) {
	    // 1000の倍数の場合はお釣りは必ず0円となる
	    // 1000の倍数でない場合は、1000-（N円の1の位～百の位）がお釣りとなる
	    int answer = 0;
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    try{
	        String str = br.readLine();
	        int n = Integer.parseInt(str);

	        if (n % 1000 != 0) {
	            System.out.println(answer);
	        } else {
	            answer = 1000 - (n % 1000);
	            System.out.println(answer);
	        }

	    } catch (IOException ioe) {

	    }
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:14: error: expected ')' before numeric constant
    6 |   printf("%d"1000-n);
      |         ~    ^~~~
      |              )
Language: C

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

int main(){
  int n;
  cin >> n;
  int t = 1000 - (n/1000);
  cout << t << 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 X;
  	cin >> X;
  if (N%1000 == 0){
 	cout << (N/1000)*1000-N << endl;
  }
  else{
    cout << (N/1000+1)*1000-N << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'N' was not declared in this scope
    7 |   if (N%1000 == 0){
      |       ^
Language: C++

int main() {
  int N;
  cin >> N;
  int a;
  a=N/1000;
  cout << 1000*(a+1)-N << endl;
  
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> N;
      |   ^~~
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout << 1000*(a+1)-N << endl;
      |   ^~~~
a.cc:6:27: error: 'endl' was not declared in this scope
    6 |   cout << 1000*(a+1)-N << endl;
      |                           ^~~~
Language: C++

int main() {
  int N;
  cin >> N;
  int a;
  a=N//1000;
  cout << 1000*(a+1)-N << endl;
  
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> N;
      |   ^~~
a.cc:5:6: error: expected ';' before 'cout'
    5 |   a=N//1000;
      |      ^
      |      ;
    6 |   cout << 1000*(a+1)-N << endl;
      |   ~~~~
Language: C++

#include <iostream>

int main() 
{
  int n;
  cin >> n;
  cout << 1000-1000%n << endl;
  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:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << 1000-1000%n << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << 1000-1000%n << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected primary-expression before '=' token
    6 |     if(n%1000 = = 0) cout << 0;
      |                 ^
Language: C++

#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;

    if(n%1000 == 0) cout << 0;
    else cout << 1000-n%1000
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: expected ';' before 'return'
    8 |     else cout << 1000-n%1000
      |                             ^
      |                             ;
    9 |     return 0;
      |     ~~~~~~
Language: Java

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

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

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    cout<<(ceil((n+0.0)/1000))*1000-n;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll n;
      |   ^~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin>>n;
      |        ^
      |        yn
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)<<endl;
}

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 'if'
    6 |   if(n%1000==0) cout<<0<<endl;
      |   ^~
a.cc:7:3: error: expected unqualified-id before 'else'
    7 |   else cout<<1000-(n%1000)<<endl;
      |   ^~~~
a.cc:8:1: error: expected declaration before '}' token
    8 | }
      | ^
Language: Java



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main

{	
	public static void main(String args[]) throws IOException
	{
		FastScanner fs = new FastScanner();
		int T = fs.nextInt();
		while(T-- >0)
		{
			int n = fs.nextInt();
			System.out.println(1000-n);
		}


}
class FastScanner
{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer str = new StringTokenizer("");
	
	String next() throws IOException
	{
		while(!str.hasMoreTokens())
			str = new StringTokenizer(br.readLine());
		
		return str.nextToken();
	}
	
	int nextInt() throws IOException
	{
		return Integer.parseInt(next());
	}
	
	float nextfloat() throws IOException
	{
		return Float.parseFloat(next());
	}
	
	double nextDouble() throws IOException
	{
		return Double.parseDouble(next());
	}
	long nextLong() throws IOException
	{
		return Long.parseLong(next());
	}
	int [] arrayIn(int n) throws IOException
	{
		int  arr[] = new int[n];
		arr[0] = 0;
		for(int i=1; i<n; i++)
		{
			arr[i] = nextInt();
		}
		return arr;
	}
}



	

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

//package project1;
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;

public class Test {

    // Complete the birthday function below.
	public static void main(String args[]) {
		Scanner sc= new Scanner(System.in);
		int n = sc.nextInt();
		int res = n-(n%1000)%1000;
		System.out.println(res);
       }
}


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Payment {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int bills = (n / 1000) + 1;
		System.out.println((bills * 1000) - n);
	}

}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define all(vec) vec.begin(),vec.end()
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
int main() {
  int N; cin >> N;
  chg = 1000-N%1000;
  cout << chg << endl;
  return 0;
}

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

import java.util.*;
public class Sample{

    public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if(n%1000==0)
    System.out.println(n);
    else { 
    int m = ((n/1000)+1)*1000;
    m = m-n;
    System.out.println(m);
    }
      //  System.out.println("Hello World");
    }
}


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

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

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>
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define mod 1000000007

void solve(int t){

    int n; cin >> n;

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    //int test; cin >> test;
    //for(int t = 1; t <= test; ++t){
        solve(t);    
    //}

    //cout << "Case #" << t << ": ";
    //cout << "\n";

    //inr(10);
	return 0;
}

int inr(int a){
    return ++a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 't' was not declared in this scope; did you mean 'tm'?
   25 |         solve(t);
      |               ^
      |               tm
Language: C++

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

int main() {
  
  int N;
  int hasu,int oturi;
  cin >> N;
  hasu=N%1000;
  oturi=1000-hasu;
  
  cout << oturi  <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected unqualified-id before 'int'
    7 |   int hasu,int oturi;
      |            ^~~
a.cc:10:3: error: 'oturi' was not declared in this scope
   10 |   oturi=1000-hasu;
      |   ^~~~~
Language: C++

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

int main() {
  
  int N;
  int hasu,int oturi;
  cin >> N;
  hasu=N%1000;
  oturi=hasu-1000;
  
  cout << oturi  <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected unqualified-id before 'int'
    7 |   int hasu,int oturi;
      |            ^~~
a.cc:10:3: error: 'oturi' was not declared in this scope
   10 |   oturi=hasu-1000;
      |   ^~~~~
Language: C++

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

int main() {
  
  int N;
  cin >> N;
  amari=N%1000;
  oturi=1000-amari;
  
  cout << oturi <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'amari' was not declared in this scope
    8 |   amari=N%1000;
      |   ^~~~~
a.cc:9:3: error: 'oturi' was not declared in this scope
    9 |   oturi=1000-amari;
      |   ^~~~~
Language: C++

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

int main() {
  cin >> N;
  
  cout << 1000-N <<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'N' was not declared in this scope
    5 |   cin >> N;
      |          ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        FastScanner fs=new FastScanner();
        int T=fs.nextInt();
        /*
        for (int tt=0; tt<T; tt++) {

        }
         */
        if (T % 1000 == 0) {
            System.out.println("0");
        } else {
            int round = (1 + (T / 1000)) * 1000
            System.out.println(round - T);
        }
    }

    void sort(int[] a) {
        ArrayList<Integer> list=new ArrayList<>();
        for (int i:a) list.add(i);
        Collections.sort(list);
        for (int i=0; i<a.length; i++) a[i]=list.get(i);
    }

    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

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

        }

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

        public int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }

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

        public long[] readLongArray(int n) {
            long[] a=new long[n];
            for (int i=0; i<n; i++) a[i]=nextLong();
            return a;
        }
    }
}

Compiler output:
Main.java:23: error: ';' expected
            int round = (1 + (T / 1000)) * 1000
                                               ^
1 error
Language: Java

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


public class main{
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        // Start writing your solution here. -------------------------------------
      /*
      int n      = sc.nextInt();        // read input as integer
      long k     = sc.nextLong();       // read input as long
      double d   = sc.nextDouble();     // read input as double
      String str = sc.next();           // read input as String
      String s   = sc.nextLine();       // read whole line as String

      int result = 3*n;
      out.println(result);                    // print via PrintWriter
      */
        // Stop writing your solution here. -------------------------------------
        int n = sc.nextInt();
        if (n % 1000 == 0) {
            out.println(0);
        } else {
            out.println(((n / 1000) + 1) * 1000);
        }
        out.close();
    }



    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            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 main is public, should be declared in a file named main.java
public class main{
       ^
1 error