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

#include<iostream>
using namespase std;

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

}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
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 >> x;
      |   ^~~
      |   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:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout << x%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<stdio.h>
 
int main()
{
	int N;
  	if(scanf("%d",&i)){}
 	//scanf("%d",&N);
  
  	int a ;
    int b = N/100;
  
  	a = N - b*100;
  
  
  	printf("%d\n",a);
  
 	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:24: error: 'i' undeclared (first use in this function)
    8 |         if(scanf("%d",&i)){}
      |                        ^
main.c:8:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main()
{
 	int N;
  	cin >> N;
  	int n = 1000;
  	for(int i = 1; i*n > N; i++ ){
    }
  	cout << i*n - N << endl;
}

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

#include <bits/stdc++.h> 
//万能だが、不要なのも多く競プロじゃないと使えない
#define rep(i, n) for(int i =0; i < (n); ++i)
// ループの変数が[i],回す回数が[n]->for文に展開される
//見やすさ、バグりにくさでいい感じ
using namespace std;
using ll =Long Long;
using P =pair<int, int>;
// 連想配列又はif文を使う
int main(){
  int n;
  cin >> n;
  map<string, int> cnt;
  rep(i, n){
    string s;
    cin >> s;
    cnt[s]++;
    //存在しなかったら０が入る
  }
  for(string s: {"AC", "WA", "TLE", "RE"}){
    //C++の便利コード　{"AC", "WA", "TLE", "RE"}イニシャライズコードー当てはまる方を推測して当てはめてくれるー＞この場合vectorのstring 文字列配列
    cout << "X" << cnt[s] << endl;
  }
  return 0;
}

Compiler output:
a.cc:7:11: error: 'Long' does not name a type; did you mean 'long'?
    7 | using ll =Long Long;
      |           ^~~~
      |           long
Language: C++

#inlcude<iostream>
using namespace std;
int main(){
  int t;cin>>t;
  int k=1000;
  while(t<0 || t==0){
    t=t-k;}
  cout<<t*(-1)<<endl;
  return 0;}
  
  
  

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |   int t;cin>>t;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude<iostream>
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout<<t*(-1)<<endl;
      |   ^~~~
a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:17: error: 'endl' was not declared in this scope
    8 |   cout<<t*(-1)<<endl;
      |                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude<iostream>
Language: Java

import java.util.Scanner;

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


Compiler output:
Main.java:3: error: class A_Payment is public, should be declared in a file named A_Payment.java
public class A_Payment {
       ^
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();
      		int answer = null;
    		answer = 1000 - N;
      		while(N < 0){
            	answer = N + 1000;
            }
      		System.out.println(N);
    }
}

Compiler output:
Main.java:7: error: incompatible types: <null> cannot be converted to int
      		int answer = null;
      		             ^
1 error
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  int A;
  cin>>A;
  cout<<(10000-N)%1000;
return 0;}

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

#include <stdio.h>
#define LENGTH 256

int main(void) {
    int MONEY;
        sscanf("%d", &MONEY);

  if(MONEY>=1){
    int AMARI;
    if(MONEY<1000){
      AMARI=MONEY;
      printf(AMARI);
      break;
    }else{
      AMARI=MONEY%1000;
      printf(AMARI);
      break;
    }
  }else{
    break;
  }
}


Compiler output:
main.c: In function 'main':
main.c:6:22: error: passing argument 2 of 'sscanf' from incompatible pointer type [-Wincompatible-pointer-types]
    6 |         sscanf("%d", &MONEY);
      |                      ^~~~~~
      |                      |
      |                      int *
In file included from main.c:1:
/usr/include/stdio.h:431:43: note: expected 'const char *' but argument is of type 'int *'
  431 |                    const char *__restrict __format, ...) __THROW;
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:12:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   12 |       printf(AMARI);
      |              ^~~~~
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:13:7: error: break statement not within loop or switch
   13 |       break;
      |       ^~~~~
main.c:16:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   16 |       printf(AMARI);
      |              ^~~~~
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:17:7: error: break statement not within loop or switch
   17 |       break;
      |       ^~~~~
main.c:20:5: error: break statement not within loop or switch
   20 |     break;
      |     ^~~~~
Language: C

#include <stdio.h>
#define LENGTH 256

int main(void) {
    int MONEY;
        sscanf(input, "%d", &MONEY);

  if(MONEY>=1){
    int AMARI;
    if(MONEY<1000){
      AMARI=MONEY;
      printf(AMARI);
      break;
    }else{
      AMARI=MONEY%1000;
      printf(AMARI);
      break;
    }
  }else{
    break;
  }
}


Compiler output:
main.c: In function 'main':
main.c:6:16: error: 'input' undeclared (first use in this function); did you mean 'int'?
    6 |         sscanf(input, "%d", &MONEY);
      |                ^~~~~
      |                int
main.c:6:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   12 |       printf(AMARI);
      |              ^~~~~
      |              |
      |              int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:13:7: error: break statement not within loop or switch
   13 |       break;
      |       ^~~~~
main.c:16:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   16 |       printf(AMARI);
      |              ^~~~~
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:17:7: error: break statement not within loop or switch
   17 |       break;
      |       ^~~~~
main.c:20:5: error: break statement not within loop or switch
   20 |     break;
      |     ^~~~~
Language: C++

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

Compiler output:
a.cc:1:20: error: missing terminating > character
    1 | #include <iostream<
      |                    ^
a.cc:1:10: fatal error: iostream<: No such file or directory
    1 | #include <iostream<
      |          ^
compilation terminated.
Language: C

#include <stdio.h>


int main(){
  int n;
  scanf("%d", &n);
  int r=10000-n;
  if(r<1000){
    printf("%d\n", &r);
  }if else(1000<=r<10000){
    while(r>=1000){
      r=r-1000;
    }
    printf("%ls\n", &r);
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:7: error: expected '(' before 'else'
   10 |   }if else(1000<=r<10000){
      |       ^~~~
      |       (
Language: C

#include <stdio.h>


int main(){
  int n;
  scanf("%d", &n);
  int r=0;
  if(n!=null){
    r=10000-n;
  }
  if(r<1000){
    printf("%d\n", &r);
  }if else(1000<=r<10000){
    while(r>=1000){
      r=r-1000;
    }
    printf("%d\n", &r);
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'null' undeclared (first use in this function)
    8 |   if(n!=null){
      |         ^~~~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:7: error: expected '(' before 'else'
   13 |   }if else(1000<=r<10000){
      |       ^~~~
      |       (
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:30: error: expected ';' before 'printf'
    6 |    r = (1000-N % 1000) % 1000
      |                              ^
      |                              ;
    7 |    printf("%d\n",r);
      |    ~~~~~~
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:16: error: lvalue required as unary '&' operand
    6 |    printf("%d",&((1000-N % 1000) % 1000);
      |                ^
main.c:6:41: error: expected ')' before ';' token
    6 |    printf("%d",&((1000-N % 1000) % 1000);
      |          ~                              ^
      |                                         )
main.c:7:13: error: expected ';' before '}' token
    7 |    return 0;
      |             ^
      |             ;
    8 |  }
      |  ~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:4:20: error: 'n' undeclared (first use in this function)
    4 |    if(scanf("%d", &n) == 1);
      |                    ^
main.c:4:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:4: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    6 |    return;
      |    ^~~~~~
main.c:2:5: note: declared here
    2 | int main(){
      |     ^~~~
Language: C++

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


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

#include <stdio.h>
 int main(){
   int N;
   printl("1000-N % 1000) % 1000 ");
   return;
 }


Compiler output:
main.c: In function 'main':
main.c:4:4: error: implicit declaration of function 'printl'; did you mean 'printf'? [-Wimplicit-function-declaration]
    4 |    printl("1000-N % 1000) % 1000 ");
      |    ^~~~~~
      |    printf
main.c:5:4: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    5 |    return;
      |    ^~~~~~
main.c:2:6: note: declared here
    2 |  int main(){
      |      ^~~~
Language: C

#include <stdio.h>
 int main(){
   int N;
   count << 1000-N % 1000) % 1000 << endl;
   return;
 }


Compiler output:
main.c: In function 'main':
main.c:4:4: error: 'count' undeclared (first use in this function)
    4 |    count << 1000-N % 1000) % 1000 << endl;
      |    ^~~~~
main.c:4:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:26: error: expected ';' before ')' token
    4 |    count << 1000-N % 1000) % 1000 << endl;
      |                          ^
      |                          ;
main.c:4:26: error: expected statement before ')' token
main.c:4:28: error: expected expression before '%' token
    4 |    count << 1000-N % 1000) % 1000 << endl;
      |                            ^
main.c:5:4: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    5 |    return;
      |    ^~~~~~
main.c:2:6: note: declared here
    2 |  int main(){
      |      ^~~~
Language: Java

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


Compiler output:
Main.java:2: 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: Java

import java.util.Scanner;

public class Payment {
    public static void main(String[] args) {
        var key = new Scanner(System.in);
        var n = key.nextInt();
        if (n % 1000 == 0) {
            System.out.println(0);
        } else {
            System.out.println(1000-n%1000);
        }
    }
}


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

import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int C1=0,C2=0,C3=0,C4=0;
		for(int i=1;i<n;i++){
			String result = sc.next();
			switch (result){
			case "AC":
				C1++;
			case "WA":
				C2++;
			case "TLE":
				C3++;
			case "RE":
				C4++;
			default:
			}
		}
		System.out.println("AC x "+ String.valueOf(C1));
		System.out.printaln("WA x "+ String.valueOf(C2));
		System.out.println("TLE x "+ String.valueOf(C3));
		System.out.println("Re x "+ String.valueOf(C4));
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
		System.out.printaln("WA x "+ String.valueOf(C2));
		          ^
  symbol:   method printaln(String)
  location: variable out of type PrintStream
1 error
Language: C

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

void main (void)
{
  int index, ac, wa, tle, re;
  index = ac = wa = tle = re = 0;
  char c[3];
  ret = scanf("%d", &index);
  if( ret == EOF ) {
    printf( "scanfでエラー\n" );
    return -1;
  }
  for (int i = 0; i < index; i++) {
    ret = scanf("%s", c);
    if( ret == EOF ) {
      printf( "scanfでエラー\n" );
      return -1;
    }
    if (strcmp(c, "AC")) {
      ++ac;
    } else if (strcmp(c, "WA")) {
      ++wa;
    } else if (strcmp(c, "TLE")) {
      ++tle;
    } else {
      ++re;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ac, wa, tle, re);
  return;
}

Compiler output:
main.c: In function 'main':
main.c:9:3: error: 'ret' undeclared (first use in this function); did you mean 're'?
    9 |   ret = scanf("%d", &index);
      |   ^~~
      |   re
main.c:9:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:12: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   12 |     return -1;
      |            ^
main.c:4:6: note: declared here
    4 | void main (void)
      |      ^~~~
main.c:18:14: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   18 |       return -1;
      |              ^
main.c:4:6: note: declared here
    4 | void main (void)
      |      ^~~~
Language: C

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


int main(void){
  int num,a;
  char bb[80];
  gets(bb);
  a=atoi(bb);
  for(int n=1;n<=10;n++){
    if(1000*(n-1)<a&&a<1000*n){
      printf("%d",1000n-a);
    }
  }
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |   gets(bb);
      |   ^~~~
      |   fgets
main.c:12:19: error: invalid suffix "n" on integer constant
   12 |       printf("%d",1000n-a);
      |                   ^~~~~
Language: C

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


int main(void){
  int num,a;
  char bb[80];
  gets(bb);
  a=atoi(bb);
  for(int n=1;n<=10;n++){
    if(1000(n-1)<a&&a<1000n){
      printf("%d",1000n-a);
    }
  }
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |   gets(bb);
      |   ^~~~
      |   fgets
main.c:11:8: error: called object is not a function or function pointer
   11 |     if(1000(n-1)<a&&a<1000n){
      |        ^~~~
main.c:11:23: error: invalid suffix "n" on integer constant
   11 |     if(1000(n-1)<a&&a<1000n){
      |                       ^~~~~
main.c:12:19: error: invalid suffix "n" on integer constant
   12 |       printf("%d",1000n-a);
      |                   ^~~~~
Language: C

#include <stdio.h>

int main (void){ 
  int N
  int n
  scanf("%d", &N);
  n = ((N / 1000) + 1) * 1000 - N; 
  printf(n);
}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected ';' before 'int'
    4 |   int N
      |        ^
      |        ;
    5 |   int n
      |   ~~~   
main.c:6:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    6 |   scanf("%d", &N);
      |   ^~~~~
main.c:6:16: error: 'N' undeclared (first use in this function)
    6 |   scanf("%d", &N);
      |                ^
main.c:6:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:3: error: 'n' undeclared (first use in this function)
    7 |   n = ((N / 1000) + 1) * 1000 - N;
      |   ^
Language: C++

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

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

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


Compiler output:
a.cc:15:5: error: redefinition of 'int main()'
   15 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: Java

import java.util.Scanner;

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

      int n = sc.nextInt();
      
      System.out.println((10000-n)/1000);
      sc.close();
      }
}


Compiler output:
Main.java:4: error: repeated modifier
    public static public void main(String[] args){
                  ^
1 error
Language: Java

import java.util.Scanner;

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

      int n = sc.nextInt();

      int x = (n+1000-1)/1000;
      int change = x*1000 - n;

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


Compiler output:
Main.java:4: error: repeated modifier
    public static public void main(String[] args){
                  ^
1 error
Language: Java

import java.util.Scanner;

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

      int n = sc.nextInt();

      int x = (n+1000-1)/1000;
      int change = x*1000 - n;

      System.out.println(change);
      }
}


Compiler output:
Main.java:4: error: repeated modifier
    public static public void main(String[] args){
                  ^
1 error
Language: Java

import java.util.Scanner;

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

      int n;
      System.out.print("N:");
      n = sc.nextInt();

      int x = (n+1000-1)/1000;
      int change = x*1000 - n;

      System.out.println(change);
      }
}


Compiler output:
Main.java:4: error: repeated modifier
    public static public void main(String[] args){
                  ^
1 error
Language: C++

#include <iostream>
using namespace std;
int main(void)
{
  int n;
  cin >> n;
  int ans = 1000-(n%1000);


Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: expected '}' at end of input
    7 |   int ans = 1000-(n%1000);
      |                           ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

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

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

public class at173_a {
  public static void main(String args[]){
    int n;
    int x = (n+1000-1)/1000;
    int ans = x*1000 - n;
  }
}


Compiler output:
Main.java:1: error: class at173_a is public, should be declared in a file named at173_a.java
public class at173_a {
       ^
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 IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int  n = Integer.parseInt(br.readLine());
        if(n%1000==0)
            System.out.println(0);
        else
            System.out.println(1000 - (n%1000));
    }
}


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

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

Compiler output:
Main.java:3: error: '(' expected
	public static void main{String args[]}{
	                       ^
Main.java:3: error: ';' expected
	public static void main{String args[]}{
	                                     ^
2 errors
Language: Java

import java.util.Scanner;

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

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int oturi=N;
        for(int i=0; i<N;i++){
            oturi= N-i*1000;
            if(oturi<1000){
                break;
            }
        }
        System.out.println(oturi);

    }
}



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

import java.util.Scanner;

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

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int oturi=N;
        for(int i=0; i<N;i++){
            oturi= N-i*1000;
            if(oturi<1000){
                break;
            }
        }
        System.out.println(oturi);

    }
}



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

#include <iostream>

using namespace std;

int main()
{
  int N;
  cin >> N;
  
  bills = ceil(N / 1000);
  change = N - bill * 1000;
  
  cout << change << endl;
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'bills' was not declared in this scope
   10 |   bills = ceil(N / 1000);
      |   ^~~~~
a.cc:10:11: error: 'ceil' was not declared in this scope
   10 |   bills = ceil(N / 1000);
      |           ^~~~
a.cc:11:3: error: 'change' was not declared in this scope
   11 |   change = N - bill * 1000;
      |   ^~~~~~
a.cc:11:16: error: 'bill' was not declared in this scope
   11 |   change = N - bill * 1000;
      |                ^~~~
Language: C

#include<stdio.h>

int main(void){
  int a, b;
  
  scanf("%d", &a);
  b = 1 % 1000;
  p;rintf("%d", 1000 - b);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: 'p' undeclared (first use in this function)
    8 |   p;rintf("%d", 1000 - b);
      |   ^
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:5: error: implicit declaration of function 'rintf' [-Wimplicit-function-declaration]
    8 |   p;rintf("%d", 1000 - b);
      |     ^~~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'rintf'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c:8:5: warning: incompatible implicit declaration of built-in function 'rintf' [-Wbuiltin-declaration-mismatch]
    8 |   p;rintf("%d", 1000 - b);
      |     ^~~~~
main.c:8:5: note: include '<math.h>' or provide a declaration of 'rintf'
main.c:8:11: error: incompatible type for argument 1 of 'rintf'
    8 |   p;rintf("%d", 1000 - b);
      |           ^~~~
      |           |
      |           char *
main.c:8:11: note: expected 'float' but argument is of type 'char *'
main.c:8:5: error: too many arguments to function 'rintf'
    8 |   p;rintf("%d", 1000 - b);
      |     ^~~~~
Language: C

#include <stdio.h>

#define LENGTH 256

int main( void ) {
  char input[LENGTH];
  int N;

  fgets(input, 256, stdin);
  sscanf(input, "%d", &N);
  if(n>=1 && N<= 10000){
      printf("%d\n", 1000-N%1000);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:6: error: 'n' undeclared (first use in this function)
   11 |   if(n>=1 && N<= 10000){
      |      ^
main.c:11:6: 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;
  cout << (1000-n%1000)%1000
}

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

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

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:9: error: 'cout' was not declared in this scope
    5 |         cout<<1000-n;
      |         ^~~~
a.cc:7:8: error: 'cout' was not declared in this scope
    7 |   else cout<<n%1000;
      |        ^~~~
Language: C++

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


Compiler output:
a.cc:2:1: error: 'payment' does not name a type
    2 | payment std;
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout <<(1000 -N % 1000) % 1000 << endl;
      |   ^~~~
      |   std::cout
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:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout <<(1000 -N % 1000) % 1000 << 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)
      |     ^~~~
a.cc:7:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
    7 |   return;
      |   ^~~~~~
Language: C++

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


Compiler output:
a.cc:2:1: error: 'payment' does not name a type
    2 | payment std;
      | ^~~~~~~
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 /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:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout <<(1000 -N % 1000) % 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:8:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout <<(1000 -N % 1000) % 1000 << 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)
      |     ^~~~
a.cc:9:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |   return;
      |   ^~~~~~
Language: C++

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


Compiler output:
a.cc:2:1: error: 'payment' does not name a type
    2 | payment std;
      | ^~~~~~~
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:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout <<(1000 -N % 1000) % 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:8:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout <<(1000 -N % 1000) % 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 <stdio.h>
payment std;
 
int main() {
  int N;
  
  cin >>N;
  cout <<(1000 -N % 1000) % 1000 << endl;
}


Compiler output:
main.c:2:1: error: unknown type name 'payment'
    2 | payment std;
      | ^~~~~~~
main.c: In function 'main':
main.c:7:3: error: 'cin' undeclared (first use in this function)
    7 |   cin >>N;
      |   ^~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:3: error: 'cout' undeclared (first use in this function)
    8 |   cout <<(1000 -N % 1000) % 1000 << endl;
      |   ^~~~
main.c:8:37: error: 'endl' undeclared (first use in this function)
    8 |   cout <<(1000 -N % 1000) % 1000 << endl;
      |                                     ^~~~
Language: C

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


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

#include <bits/stdc++.h>
payment std;
 
int main() {
  int N;
  
  cin >>N;
  cout <<(1000 -N % 1000) % 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>
payment std;
 
int main() {
  int N;
  if(N<=10000)
  cout << (1000 - N % 1000) % 1000 << endl;
  return 0;
}


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>
payment std;
 
int main() {
  int N;
  if(N<=10000)
  printf("10000-N");
  return 0;
}


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

  if(N<=1000 ){
        cout<<"0";
    }
    else if(N>1000 && N<=2000)
        N=2000-N;
    else if(N>2000 && N<=3000)
          N=3000-N;
    else if(N>3000 && N<=4000)
          N=4000-N;
    else if(N>4000 && N<=5000)
          N=5000-N;
    else if(N>5000 && N<=6000)
          N=6000-N;
    else if(N>6000 && N<=7000)
          N=7000-N;
     else if(N>7000 && N<=8000)
          N=8000-N;
     else if(N>8000 && N<=9000)
          N=9000-N;
    else if(N>9000 && N<=10000)
          N=10000-N;

Compiler output:
a.cc:1:3: error: expected unqualified-id before 'if'
    1 |   if(N<=1000 ){
      |   ^~
a.cc:4:5: error: expected unqualified-id before 'else'
    4 |     else if(N>1000 && N<=2000)
      |     ^~~~
a.cc:6:5: error: expected unqualified-id before 'else'
    6 |     else if(N>2000 && N<=3000)
      |     ^~~~
a.cc:8:5: error: expected unqualified-id before 'else'
    8 |     else if(N>3000 && N<=4000)
      |     ^~~~
a.cc:10:5: error: expected unqualified-id before 'else'
   10 |     else if(N>4000 && N<=5000)
      |     ^~~~
a.cc:12:5: error: expected unqualified-id before 'else'
   12 |     else if(N>5000 && N<=6000)
      |     ^~~~
a.cc:14:5: error: expected unqualified-id before 'else'
   14 |     else if(N>6000 && N<=7000)
      |     ^~~~
a.cc:16:6: error: expected unqualified-id before 'else'
   16 |      else if(N>7000 && N<=8000)
      |      ^~~~
a.cc:18:6: error: expected unqualified-id before 'else'
   18 |      else if(N>8000 && N<=9000)
      |      ^~~~
a.cc:20:5: error: expected unqualified-id before 'else'
   20 |     else if(N>9000 && N<=10000)
      |     ^~~~
Language: C

#include <stdio.h>

int main(){

	int n;
	int x = (n+1000-1)/1000
	int ans = x*1000 - n;
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected ',' or ';' before 'int'
    7 |         int ans = x*1000 - n;
      |         ^~~
Language: C

int main(){

	int n;
	int x = (n+1000-1)/1000
	int ans = x*1000 - n;
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: expected ',' or ';' before 'int'
    5 |         int ans = x*1000 - n;
      |         ^~~
Language: C

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


void solve() {
  int N;
  scanf("%d", &N);
  int otsuri = 0;
  rep(i, 11) {
    if (i*1000 > N) {
      otsuri = i*1000-N;
      break;
    }
  }

  cout << otsuri << "\n";
}

int main() {
  solve();
  return 0;
}


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 <stdio.h>

int main(void){
  	int n;
  	scanf("%d", &n);
  	
  	int i = 0;
  	while(i < 10){
        if(i * 1000 <= n && n <=(i + 1) * 1000){
            int Change = (i + 1) * 1000 - n;
        }
    }
      
  	printf("%d", Change);
}

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

#include <stdio.h>
#include<string.h>
#define LENGTH 256

int calculate(int price){
    int charge;
    int i = 0;
    while(1){
        charge = i*1000 - price;
        if(charge>0){
            return charge;
        }else if(charge == 0){
            return charge;
        }else{
            i = i+1;
        }
    }

}
int main(void) {
    char input[LENGTH];
    int r,n;
    while(1){
        printf("price: ");
        fgets(input, LENGTH-1, stdin);
        sscanf(input, "%d", &n);
        if (n<0) break;
        r = calculate(n);
        printf("%d\n", r);

    }

Compiler output:
main.c: In function 'main':
main.c:31:5: error: expected declaration or statement at end of input
   31 |     }
      |     ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  double x, n;
  cin >> x;
  n = ceil(x / 1000);
  cout << n * 1000 - x << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'ceil' was not declared in this scope
    7 |   n = ceil(x / 1000);
      |       ^~~~
Language: C

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

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

#include <stdio.h>
 
int main(void){
 
  int N, change;
  
  printf("N = ");
  scanf("%d", &N);
  
  change = 1000 - (N % 1000);
  
  printf("%d", change);
  
  return 0;
}
#include <stdio.h>
 
int main(void){
  
  char money[5];
  
  int N, change;
  
  printf("N = ");
  scanf("%d", &N);
  
  change = N & 1000;
  
  printf("%d", change);
  
  return 0;
}

Compiler output:
main.c:18:5: error: redefinition of 'main'
   18 | int main(void){
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main(void){
      |     ^~~~
Language: C

#include <stdio.h>
 
int main(void){

  int N, change;
  
  printf("N = ");
  scanf("%d", &N);
  
  change = 1000 - (N % 1000);
  
  printf("%d", change);
  
  return 0;
}
#include <stdio.h>

int main(void){
  
  char money[5];
  
  int N, change;
  
  printf("N = ");
  scanf("%d", &N);
  
  change = N & 1000;
  
  printf("%d", change);
  
  return 0;
}
提出情報 

Compiler output:
main.c:18:5: error: redefinition of 'main'
   18 | int main(void){
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main(void){
      |     ^~~~
main.c:33:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   33 | 提出情報
      | ^~~~~~~~
Language: C++

#include <iostream>

using namespace std;

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


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  ll 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:4:3: error: 'll' was not declared in this scope
    4 |   ll int n;
      |   ^~
a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin>>n;
      |        ^
      |        yn
Language: C++

int main()
{

printf("購入した商品の値段を入力してください\n");
int N;
scanf("%d",&N);
 for (int i = 1; i < 11; i++){
 int u = i*1000;
 if(N <= u){
 int x;
 x = u - N;
  printf("%d\n",x);break;
}
 else {
        printf("Failed to read integer.\n");}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'printf' was not declared in this scope
    4 | printf("購入した商品の値段を入力してください\n");
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
a.cc:6:1: error: 'scanf' was not declared in this scope
    6 | scanf("%d",&N);
      | ^~~~~
Language: C++

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

int main(){
  int n; cin >> n;
  int ans=1000-n%1000;
  printf("%d\n",ans);
}

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   int n; 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:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << ans << 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<bits/stdc++.h>
#include<cstdio>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   int n; 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:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout << 1000-n%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:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout << 1000-n%1000 << 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<bits/stdc++/h>
#include<cstdio>

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

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