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

#include<bits/stdc++.h>
int checkprime(int);
void main()
{
int x,n,ans;
cout<<"Enter the number";
cin>>x;
ans=0;
while(ans=0)
{
ans=checkprime(x);
if(ans==1)
{
cout<<x;
break;
{
x++;
}
}
int checkprime(int x)
{
      int i=2,;
while(i<x)
{
if(x%i!=0)
{
    i++;
}
else
break;
}
if(i==x)
return 1;
else 
return 0;
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | cout<<"Enter the number";
      | ^~~~
      | 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:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin>>x;
      | ^~~
      | std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:1: error: a function-definition is not allowed here before '{' token
   21 | {
      | ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<bits/stdc++.H>
int checkprime(int);
void main()
{
int x,n,ans;
cout<<"Enter the number";
cin>>x;
ans=0;
while(ans=0)
{
ans=checkprime(x);
if(ans==1)
{
cout<<x;
break;
{
x++;
}
}
int checkprime(int x)
{
      int i=2,;
while(i<x)
{
if(x%i!=0)
{
    i++;
}
else
break;
}
if(i==x)
return 1;
else 
return 0;
}

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

#include<iostream.h>
#include<conio.h>
int checkprime(int);
void main()
{
int x,n,ans;
cout<<"Enter the number";
cin>>x;
ans=0;
while(ans=0)
{
ans=checkprime(x);
if(ans==1)
{
cout<<x;
break;
{
x++;
}
}
int checkprime(int x)
{
      int i=2,;
while(i<x)
{
if(x%i!=0)
{
    i++;
}
else
break;
}
if(i==x)
return 1;
else 
return 0;
}

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

#include<stdio.h>
#include<stdlib.h>
int main()
{
int j,n,i,c=0;
scanf("%d",&n);
for(i=n;i>=n;i++)
{
c=0;
for(j=2;j<i;j++)
{
if(i%j==0)
c++;
}
if(c==0)
{
printf("%d",i);
exit(0);
}
}

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

#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,i,c=0;
scanf("%d",&n);
for(i=n;i>=n;i++)
{
c=0;
for(j=2;j<i;j++)
{
if(i%j==0)
c++;
}
if(c==0)
{
printf("%d",i);
exit(0);
}
}

Compiler output:
main.c: In function 'main':
main.c:10:5: error: 'j' undeclared (first use in this function)
   10 | for(j=2;j<i;j++)
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:1: error: expected declaration or statement at end of input
   20 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
int n,i,c=0;
scanf("%d",&n);
for(i=n;i>=n;i++)
{
c=0;
for(j=2;j<i;j++)
{
if(i%j==0)
c++;
}
if(c==0)
{
printf("%d",i);
exit(0);
}
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: 'j' undeclared (first use in this function)
    9 | for(j=2;j<i;j++)
      |     ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:1: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   17 | exit(0);
      | ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main()
main.c:17:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   17 | exit(0);
      | ^~~~
main.c:17:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C++



#include<stdio.h>
#include<iostream>
int main()
{
int n,i,c=0;
cin>>n;
for(i=n;i>=n;i++)
{
c=0;
for(j=2;j<i;j++)
{
if(i%j==0)
c++;
}
if(c==0)
{
cout<<i;
exit(0);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | cin>>n;
      | ^~~
      | std::cin
In file included from a.cc:4:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:5: error: 'j' was not declared in this scope
   12 | for(j=2;j<i;j++)
      |     ^
a.cc:19:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 | cout<<i;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<stdio.h>
int main()
{
int n,i,c=0;
cin>>n;
for(i=n;i>=n;i++)
{
c=0;
for(j=2;j<i;j++)
{
if(i%j==0)
c++;
}
if(c==0)
{
cout<<i;
exit(0);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin>>n;
      | ^~~
a.cc:9:5: error: 'j' was not declared in this scope
    9 | for(j=2;j<i;j++)
      |     ^
a.cc:16:1: error: 'cout' was not declared in this scope
   16 | cout<<i;
      | ^~~~
a.cc:17:1: error: 'exit' was not declared in this scope
   17 | exit(0);
      | ^~~~
a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<stdio.h>
  +++ |+#include <cstdlib>
    2 | int main()
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: Java

import java.util.*;
public class Solution{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int x = nextInt();
int flag = 0;
for(int i=x; i<2*x; i++){
for(int j=2; j/x<x; j++){
if(i%j == 0){
flag = 0;
break;
}
else{
flag = 1;
}
}
if(flag == 1)
break;
}
System.out.print(i);
}
}

Compiler output:
Main.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
       ^
Main.java:5: error: cannot find symbol
int x = nextInt();
        ^
  symbol:   method nextInt()
  location: class Solution
Main.java:20: error: cannot find symbol
System.out.print(i);
                 ^
  symbol:   variable i
  location: class Solution
3 errors
Language: Java

public class Solution{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int x = nextInt();
int flag = 0;
for(int i=x; i<2*x; i++){
for(int j=2; j/x<x; j++){
if(i%j == 0){
flag = 0;
break;
}
else{
flag = 1;
}
}
if(flag == 1)
break;
}
System.out.print(i);
}
}

Compiler output:
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
       ^
Main.java:3: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
  symbol:   class Scanner
  location: class Solution
Main.java:3: error: cannot find symbol
Scanner in = new Scanner(System.in);
                 ^
  symbol:   class Scanner
  location: class Solution
Main.java:4: error: cannot find symbol
int x = nextInt();
        ^
  symbol:   method nextInt()
  location: class Solution
Main.java:19: error: cannot find symbol
System.out.print(i);
                 ^
  symbol:   variable i
  location: class Solution
5 errors
Language: Java

public class Solution{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int x = nextInt();
int flag = 0;
for(int i=x; i<2*x; i++){
for(int j=2; j/x<x; j++){
if(i%j == 0){
flag = 0;
break;
}
else{
flag = 1;
}
}
if(flag == 1)
break;
}
}
System.out.print(i);
}
}

Compiler output:
Main.java:20: error: <identifier> expected
System.out.print(i);
                ^
Main.java:20: error: <identifier> expected
System.out.print(i);
                  ^
Main.java:22: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

public Solution{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int x = nextInt();
int flag = 0;
for(int i=x; i<2*x; i++){
for(int j=2; j/x<x; j++){
if(i%j == 0){
flag = 0;
break;
}
else{
flag = 1;
}
}
if(flag == 1)
break;
}
}
System.out.print(i);
}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
public Solution{
       ^
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)
Main.java:20: error: class, interface, enum, or record expected
System.out.print(i);
^
Main.java:21: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

Scanner in = new Scanner(System.in);
int x = nextInt();
int flag = 0;
for(int i=x; i<2*x; i++){
for(int j=2; j/x<x; j++){
if(i%j == 0){
flag = 0;
break;
}
else{
flag = 1;
}
}
if(flag == 1)
break;
}
}
System.out.print(i);

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner in = new Scanner(System.in);
^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: class, interface, enum, or record expected
for(int i=x; i<2*x; i++){
^
Main.java:4: error: class, interface, enum, or record expected
for(int i=x; i<2*x; i++){
             ^
Main.java:4: error: class, interface, enum, or record expected
for(int i=x; i<2*x; i++){
                    ^
Main.java:5: error: class, interface, enum, or record expected
for(int j=2; j/x<x; j++){
             ^
Main.java:5: error: class, interface, enum, or record expected
for(int j=2; j/x<x; j++){
                    ^
Main.java:8: error: class, interface, enum, or record expected
break;
^
Main.java:9: error: class, interface, enum, or record expected
}
^
Main.java:12: error: class, interface, enum, or record expected
}
^
Main.java:16: error: class, interface, enum, or record expected
}
^
10 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
bool Check(int X) {
    bool flg = true;
    for (int i = 2; i < X; i++) {
        if ((X % i) == 0) {
            flg = false;
            break;
        }
    }
    return flg;
 
}
 
int main(){
    int X;
    
     cin >> X;
    while (1) {
        if (Check(X)) {
            break;
        }
        X++;
    }
 
    cout << X;
    return 0;
}
using namespace std;
 
bool Check(int X) {
    bool flg = true;
    for (int i = 2; i < X; i++) {
        if ((X % i) == 0) {
            flg = false;
            break;
        }
    }
    return flg;
 
}
 
int main(){
    int X;
    
     cin >> X;
    while (1) {
        if (Check(X)) {
            break;
        }
        X++;
    }
 
    cout << X;
    return 0;
}
using namespace std; 
bool Check(int X) {
    bool flg = true;
    for (int i = 2; i < X; i++) {
        if ((X % i) == 0) {
            flg = false;
            break;
        }
    }
    return flg;
 
}
 
int main(){
    int X;
    
     cin >> X;
    while (1) {
        if (Check(X)) {
            break;
        }
        X++;
    }
 
    cout << X;
    return 0;
}
using namespace std;
 
bool Check(int X) {
    bool flg = true;
    for (int i = 2; i < X; i++) {
        if ((X % i) == 0) {
            flg = false;
            break;
        }
    }
    return flg;
 
}
 
int main(){
    int X;
    
     cin >> X;
    while (1) {
        if (Check(X)) {
            break;
        }
        X++;
    }
 
    cout << X;
    return 0;
}

Compiler output:
a.cc:32:6: error: redefinition of 'bool Check(int)'
   32 | bool Check(int X) {
      |      ^~~~~
a.cc:4:6: note: 'bool Check(int)' previously defined here
    4 | bool Check(int X) {
      |      ^~~~~
a.cc:44:5: error: redefinition of 'int main()'
   44 | int main(){
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main(){
      |     ^~~~
a.cc:59:6: error: redefinition of 'bool Check(int)'
   59 | bool Check(int X) {
      |      ^~~~~
a.cc:4:6: note: 'bool Check(int)' previously defined here
    4 | bool Check(int X) {
      |      ^~~~~
a.cc:71:5: error: redefinition of 'int main()'
   71 | int main(){
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main(){
      |     ^~~~
a.cc:87:6: error: redefinition of 'bool Check(int)'
   87 | bool Check(int X) {
      |      ^~~~~
a.cc:4:6: note: 'bool Check(int)' previously defined here
    4 | bool Check(int X) {
      |      ^~~~~
a.cc:99:5: error: redefinition of 'int main()'
   99 | int main(){
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main(){
      |     ^~~~
Language: C++

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

long long N=0,K=0,M=0,A=0,B=0,ans=0,p=0;
long long n=0,x=0,s=0,t=0;
vector<int> P(100000,0);
P[0]=2;
string S;
int j =0;
int main(){
    cin >> x;
    for(int i=2;i < x;i++){
        n=0;
        for(j=0;j<=s;j++){
            if(i%P[j]==0){
                break;
                n=1;
            }
        }
        if(n==0) {
            s++;
            P[s]=j;
        }
    }
    j=0;
    for(int i =P[s]+1;;i++){
        n=0;
        for(j=0;j<=s;j++){
            if(i%P[j]==0){
                break;
                n=1;
            }
        }
        if(n==0) {
            ans=j;
        break;
        }
    }

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:10:1: error: 'P' does not name a type
   10 | P[0]=2;
      | ^
Language: C

#include <stdio.h>
 
int main(void){
  int N;
  int i;
  
  scanf("%d",&N);
  
  if(N % 2 != 0 && N % 3 != 0 && N % 5 != 0 && N % 7 != 0){
    printf("%d\n",N);
  } else {
    for(i=N+1;i<10000;i++){
      if(i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0)
        break;
    }
    printf("%d\n",i);
  }
  
  return 0;
}
#include <stdio.h>
 
int main(void){
  int N;
  int i;
  
  scanf("%d",&N);
  
  if(N % 2 != 0 && N % 3 != 0 && N % 5 != 0 && N % 7 != 0){
    printf("%d\n",N);
  } else {
    for(i=N+1;i<100000i++){
      if(i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0)
        break;
    }
    printf("%d\n",i);
  }
  
  return 0;
}
提出情報

Compiler output:
main.c:23:5: error: redefinition of 'main'
   23 | int main(void){
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main(void){
      |     ^~~~
main.c: In function 'main':
main.c:32:24: error: lvalue required as increment operand
   32 |     for(i=N+1;i<100000i++){
      |                        ^~
main.c:32:26: error: expected ';' before ')' token
   32 |     for(i=N+1;i<100000i++){
      |                          ^
      |                          ;
main.c: At top level:
main.c:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   41 | 提出情報
      | ^~~~~~~~
Language: C

#include <stdio.h>

int main(void){
  int N;
  int i;
  
  scaanf("%d",&N);
  
  if(N % 2 != 0 && N % 3 != 0 && N % 5 != 0 && N % 7 != 0){
    printf("%d\n",N);
  } else {
    for(i=N+1;i<10000;i++){
      if(i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0)
        break;
    }
    printf("%d\n",i);
  }
  
  return 0;
}
  
  
    

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

#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#include <numeric>
#include <unordered_map>

using namespace std;


bool isPrime(int num){
    if(num==2)
        return true;
    if(num%2==0)
        return false;

    for(int i=3; i<=sqrt(num); i+=2){
        if(num%i==0)
            return false;
    }
    return true;
}

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

    for(int i=X; i<=INT_MAX; i++){
        if(isPrime(i)){
            cout << i << endl;
            break;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'bool isPrime(int)':
a.cc:17:21: error: 'sqrt' was not declared in this scope
   17 |     for(int i=3; i<=sqrt(num); i+=2){
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:28:21: error: 'INT_MAX' was not declared in this scope
   28 |     for(int i=X; i<=INT_MAX; i++){
      |                     ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <unordered_map>
  +++ |+#include <climits>
    7 |
Language: C++

#include<iostream>
using namespace std;
int main(){
  int X;
  cin >> X;
  for(int i = X;i < 130000;i++){
    for(int j = 2;j < i;j++){
      if(i % j == 0) break;
    }
    if(i == j){
      cout << i;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'j' was not declared in this scope
   10 |     if(i == j){
      |             ^
Language: C++

#include<stdio.h>

bool IsPrime(int a)
{
	for (int i=a-1; i<1; i--0{
    	if(a%i == 0 ) return false;
    }
    return true;
}

int main()
{
 	int x;
  	scanf("%d" &x);
  
  	while(1){
		if(IsPrime(x)) break;
      	x++;
    }
}

Compiler output:
a.cc: In function 'bool IsPrime(int)':
a.cc:5:33: error: expected ')' before numeric constant
    5 |         for (int i=a-1; i<1; i--0{
      |             ~                   ^
      |                                 )
a.cc:5:34: error: expected ';' before '{' token
    5 |         for (int i=a-1; i<1; i--0{
      |                                  ^
      |                                  ;
a.cc: In function 'int main()':
a.cc:14:20: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
   14 |         scanf("%d" &x);
      |               ~~~~ ^~
      |               |     |
      |               |     int
      |               const char [3]
Language: C++

#include<bits/stdc++.h>
using namespace std;
 bool check[100007];
int numberOfPrime(int n){
  if(n<2) return 0;
  int cnt=1;
 
  for(int i=3;i<=n;i+=2){
    {
      if(check[i]==false){
        cnt++;
        for(int j=i+i;j<=n;j+=i){
          check[j]=true;
        }
      }
    }
    return cnt;
}
int main(){
    int n;
  	cin>>n;
  cout<<numberOfPrime(n)<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int numberOfPrime(int)':
a.cc:19:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   19 | int main(){
      |         ^~
a.cc:19:9: note: remove parentheses to default-initialize a variable
   19 | int main(){
      |         ^~
      |         --
a.cc:19:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:19:11: error: a function-definition is not allowed here before '{' token
   19 | int main(){
      |           ^
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:25: note: to match this '{'
    4 | int numberOfPrime(int n){
      |                         ^
a.cc:24:2: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      |  ^
Language: C++

#include<iostream>
#include<sstream>

using namespace std;

int main(){
  long long x;
  cin>>x;
  long long i=x;
  long long flag=0;
  while(true){
    flag=0;
    for(long long j=2; j<sqrt(i); j++){
      if(i%j==0){
        flag++;
        break;
      }
    }
    if(flag==0){
      break;
    }
    i++;
  }
  cout<<i<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: 'sqrt' was not declared in this scope
   13 |     for(long long j=2; j<sqrt(i); j++){
      |                          ^~~~
Language: C

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

int hantei(long x);

int main(){
  long X,n;  
  scanf("%ld",&X);
  n=X;
  while(hantei(n) = 0){
    n++;
  }
  printf("%lf",n); 
  return 0;
}

int hantei(long x){
  long i,y;
  y=sqrt(x);
  
  if(x%2==0)
    return 0;
  
  for(i=3;i<y;i+=2){
    if(x%i==0)
      return 0;
  }
  
  return 1;
}

    
    
    

Compiler output:
main.c: In function 'main':
main.c:10:19: error: lvalue required as left operand of assignment
   10 |   while(hantei(n) = 0){
      |                   ^
Language: C++

#include<iostream>
#include<math.h> 

using namespace std;

int prime(int x){
	int flag=1,m;
	if(x<4) m=x;
	else {
		if(x%2==0)
		m=x+1;
		else m=x;
		do{
			flag=0;
			for(int i=3;i<sqrt(m)&&flag;i+=2){
				if(m%i==0){
					flag=1;
				}
			}
		
		}while(!flag)
	}	
	return m;
}

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

Compiler output:
a.cc: In function 'int prime(int)':
a.cc:21:30: error: expected ';' before '}' token
   21 |                 }while(!flag)
      |                              ^
      |                              ;
   22 |         }
      |         ~
Language: Java

import java.util.Scanner;

public class Next_Prime {

    public static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        int x = scanner.nextInt();
        while (!isPrime(x)) {
            ++x;
        }
        System.out.println(x);

    }

    static boolean isPrime(int n) {
        if (n <= 1) {
            return false;
        }
        for (int i = 2; i * i < n; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

}


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

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

int main() {
  int x;
  cin >> x;
 
  vector<int> primes = { 2 };
  
  for (int i=3; ; i++) {
    if (all_of(primes.begin(), primes.end(), [](int x) { return i % x != 0; })) {
      if (i > x) {
        cout << i;
        return 0;
      } else {
        primes.push_back(i);
      }
    }
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> primes = { 2 };
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> primes = { 2 };
      |          ^~~
a.cc:12:16: error: 'primes' was not declared in this scope
   12 |     if (all_of(primes.begin(), primes.end(), [](int x) { return i % x != 0; })) {
      |                ^~~~~~
a.cc: In lambda function:
a.cc:12:65: error: 'i' is not captured
   12 |     if (all_of(primes.begin(), primes.end(), [](int x) { return i % x != 0; })) {
      |                                                                 ^
a.cc:12:47: note: the lambda has no capture-default
   12 |     if (all_of(primes.begin(), primes.end(), [](int x) { return i % x != 0; })) {
      |                                               ^
a.cc:11:12: note: 'int i' declared here
   11 |   for (int i=3; ; i++) {
      |            ^
Language: C++

#include <bits/stdc++.h>
uaing namespace std;
inline bool p(int x) {
 if (x<=3){
   return x>1;
  }
  
  if(!(x&1) || !(x&2)){
    return false;
  }
  
  for (int i = 5; i <= sqrt(x); i += 6) {
    if (!(x & (i-1)) || !(x&(i+1))) {
      return 0;
    }
  }
  return 1;
}
int main() {
  int x;
  cin>>x;
  for (int i =x;;++i) {
    if (p(i)) {
      cout <<i;
      return 0;
     }
   }
}

Compiler output:
a.cc:2:1: error: 'uaing' does not name a type
    2 | uaing namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   21 |   cin>>x;
      |   ^~~
      |   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:24:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |       cout <<i;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java


import java.util.*;

public class abc_typical_step{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = n;
        while(true){

            if(judge(num)){
                num +=1;
                continue;
            }

            else{
                System.out.println(num);
                break;
            }

        }
    }
  
    

    private static boolean judge(int num){
       if(num == 2) return false;
       
       for(int i = 2;i < (int)Math.pow(num,0.5); i++)
       {
            if(num % i == 0) return true;
            else continue;
       }
       return false;
    }
}

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

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

int main (void){
	int X, ans, root, i;
	int flag =0; /*判定フラグ*/
	scanf("%d", &X);
	
	while(True){
		root = (int)sqrt(X);
		
		for (i =2; i<root; ++i){
			if(X%i==0){
				flag =1;
				break;
			}
		}
		
		if (flag == 0){
			ans = X;
			break;
		}
		flag =0;
		X +=1;
	}
	
	printf("%d", ans);
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: 'True' undeclared (first use in this function)
    9 |         while(True){
      |               ^~~~
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main (void){
	int X, ans root, i;
	int flag =0; /*判定フラグ*/
	scanf("%d", &X);
	
	while(true){
		root = (int)sqrt(X);
		
		for (i =2; i<root; ++i){
			if(X%i==0){
				flag =1;
				break;
			}
		}
		
		if (flag == 0){
			ans = X;
			break;
		}
		flag =0;
		X +=1;
	}
	
	printf("%d", ans);
}

Compiler output:
main.c: In function 'main':
main.c:5:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'root'
    5 |         int X, ans root, i;
      |                    ^~~~
main.c:9:15: error: 'true' undeclared (first use in this function)
    9 |         while(true){
      |               ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
    9 |         while(true){
      |               ^~~~
main.c:10:17: error: 'root' undeclared (first use in this function)
   10 |                 root = (int)sqrt(X);
      |                 ^~~~
main.c:12:22: error: 'i' undeclared (first use in this function)
   12 |                 for (i =2; i<root; ++i){
      |                      ^
main.c:20:25: error: 'ans' undeclared (first use in this function)
   20 |                         ans = X;
      |                         ^~~
Language: C++

#include < iostream>

using namespace std;

bool kt(int x)
{
  for(int i=3; i*i<=x; ++i)
    if (x%i==0) return false;
  return true;
}

int main()
{
  int n;
  cin >> n;
  if (n%2==0) n++;
  while (!kt(n))
  n+=2;
  cout << n;
}

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

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

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main() {
    int X;
    cin >> X;
    int res = X;

    while (true) {
        if (IsPrime(res)) {
            break;
        }
        ++res;
    }

	cout << res << endl;
}


Compiler output:
a.cc: In function 'bool IsPrime(int)':
a.cc:12:22: error: 'sqrt' was not declared in this scope
   12 |     double sqrtNum = sqrt(num);
      |                      ^~~~
Language: C

#include <stdio.h>

bool is_prime(int x) {
  int i;
  if(x <= 1) return false;
  for(i = 2; i * i <= x; i++) {
    if(x%i==0) return false;
  }
  return true;
}

int main(void)
{
  int x, i;
  
  scanf("%d", &x);

  for(i = x; ; i++) {
    if(is_prime(i) == ture) break;
  }

  printf("%d\n", i);
  
  return 0;
}


Compiler output:
main.c:3:1: error: unknown type name 'bool'
    3 | bool is_prime(int x) {
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'is_prime':
main.c:5:21: error: 'false' undeclared (first use in this function)
    5 |   if(x <= 1) return false;
      |                     ^~~~~
main.c:5:21: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:10: error: 'true' undeclared (first use in this function)
    9 |   return true;
      |          ^~~~
main.c:9:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:19:23: error: 'ture' undeclared (first use in this function)
   19 |     if(is_prime(i) == ture) break;
      |                       ^~~~
Language: C++

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

bool p[100009];

int main(){
 
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int x;
	cin >> x;
	memset(1, p, sizeof p);
	p[1] = 0;
	for(int i = 2; i <= 1e5; ++i){
		if(p[i]){
			for(int j = i * i; i <= 1e5; j += i)
				p[j] = 0;
		}
	}
	for(int i = x; ; ++i)
		if(p[i])
			return cout << i << '\n', 0;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: invalid conversion from 'int' to 'void*' [-fpermissive]
   14 |         memset(1, p, sizeof p);
      |                ^
      |                |
      |                int
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
a.cc:14:19: error: invalid conversion from 'bool*' to 'int' [-fpermissive]
   14 |         memset(1, p, sizeof p);
      |                   ^
      |                   |
      |                   bool*
/usr/include/string.h:61:37: note:   initializing argument 2 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                 ~~~~^~~
Language: C++

#include<iostream>
using namespace std;
bool is_prime(int x){
  if(x<=1) return false;
  for (int i=2; i*i <=x; ++i)
    if(x%i==0) return false;
  return true;
int main(){
  int x;
  cin >> x;
  
  int p=x;
  while(!is_prime(p))p++;
  
  cout << p << endl;
  return 0;
}
    
  


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

#include<iostream>
using namespace std;
bool is_prime(int x){
  if(x<=1) return false;
  for (int i=2; i*i <=x ++i)
    if(x%i==0) return false;
  return true;
}
signed main(){
  int x;
  cin >> x;
  
  int p=x;
  while(!is_prime(p))p++;
  
  cout << p << endl;
  return 0;
}
    
  

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:5:27: error: expected ';' before 'i'
    5 |   for (int i=2; i*i <=x ++i)
      |                           ^
      |                           ;
Language: C++

#include<iostream>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  if (x % 2 == 0){
    x++;
  }
  while(true){
    for(int y = 3; y<sqrt(x); y++){
      if(x % y == 0){         
        break;
      }
    }
    x = x+2;
  }
  cout << x << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'sqrt' was not declared in this scope
   11 |     for(int y = 3; y<sqrt(x); y++){
      |                      ^~~~
Language: C++

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

bool prime(a){
  for(int i = 2; i <= sqrt(a); i++){
    if(a % i == 0) return false;
  }
  return true;
}

int main(){
  long long a;
  cin >> a;
  while(a < 100001){
    if(prime(a)) cout << a;
    a++;
  }
}


Compiler output:
a.cc:4:12: error: 'a' was not declared in this scope
    4 | bool prime(a){
      |            ^
a.cc: In function 'int main()':
a.cc:15:13: error: 'prime' cannot be used as a function
   15 |     if(prime(a)) cout << a;
      |        ~~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int prime(int x){
  bool a = true;
for(int i = 2; i * i <= x; i++){
  if(x % i == 0){
a = false;
    break;
  }
}
return a;
}

int main(){
int X;
  cin >> X;
int j = 0;
  while(!prime(x+j)) j++;
cout << x + j << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'x' was not declared in this scope
   18 |   while(!prime(x+j)) j++;
      |                ^
a.cc:19:9: error: 'x' was not declared in this scope
   19 | cout << x + j << endl;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int x;
  cin>>x;
 
  while(true){
    int flg=0;
    for(int i=2;i*i<x;i++)
     { 
       if(x%i==0){
         flg=1;
         break;
       }
     }
    if(flg==1)
      x++;
    else{
      cout<<x;
      break;}
}

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

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

bool is_prime(int X){
  if (X <= 1) return false; 
  for  (int i = 2; i * i <= X; i++) {
    if (X % i == 0) {
      return false;
    }
  return true;
  }
}

int main() {
  int X;
  cin >> X;
  int p = x;
  while(!is_prime(p)) p++;
  cout << p << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'x' was not declared in this scope
   17 |   int p = x;
      |           ^
a.cc: In function 'bool is_prime(int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C++

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

bool is_prime(long long X){
  if (X <= 1) return false; 
  for  (int i = 2; i * i <= X; i++) {
    if (X % i == 0) {
      return false;
    }
  return true;
  }
}

int main() {
  long long X;
  cin >> X;
  long long p = x;
  while(!is_prime(p)) p++;
  cout << p << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'x' was not declared in this scope
   17 |   long long p = x;
      |                 ^
a.cc: In function 'bool is_prime(long long int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

bool is_prime(int x){
    if(x<=1) return false;
    for(int i=2;i*i<=x;i++){
        if(x%i==0) return false;
        return true;
    }

}

int main(){
    int x;
    int r = 0;
    cin>>x;
    int p = x;
    for(!is_prime(p)) p++;
    cout<<p<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected ';' before ')' token
   18 |     for(!is_prime(p)) p++;
      |                     ^
      |                     ;
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:19:19: error: expected ')' before '}' token
   19 |     cout<<p<<endl;
      |                   ^
      |                   )
   20 | }
      | ~                  
a.cc:18:8: note: to match this '('
   18 |     for(!is_prime(p)) p++;
      |        ^
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc: In function 'bool is_prime(int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
Language: C

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

bool solve(int X);

int X;

int main(int argc, char const *argv[])
{
	scanf("%d", &X);
	for (int i = X; i < 10^5; ++i)
	{
		if (solve(i))
		{
			printf("%d\n", i);
			break;
		}

		else{
			i++;
		}
	}

	return 0;
}



bool solve(int X){
	if (i%2 == 0)
	{
		return false;
	}

	else{
		int x;
		x = (int)sqrt(X);
		for (int i = 3; i < X+3; i+=2)
		{
			if (X%x == 0)
			{
				return false;
			}
		}

		return true;
	}

}

Compiler output:
main.c:4:1: error: unknown type name 'bool'
    4 | bool solve(int X);
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:29:1: error: unknown type name 'bool'
   29 | bool solve(int X){
      | ^~~~
main.c:29:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'solve':
main.c:30:13: error: 'i' undeclared (first use in this function)
   30 |         if (i%2 == 0)
      |             ^
main.c:30:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:24: error: 'false' undeclared (first use in this function)
   32 |                 return false;
      |                        ^~~~~
main.c:32:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:46:24: error: 'true' undeclared (first use in this function)
   46 |                 return true;
      |                        ^~~~
main.c:46:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    
    if(x == 2){
      System.out.println(x);
      return 0;
    }
    
    boolean s = false;
    
    while(s == false){
      
      
      for(int i = 2; i < x; i ++){
        if(x % i == 0){
          s = false;
          break;
        }
        s = true;
      }
      
      
      
      x += 1;
    }
    
    System.out.println(x-1);
    
  }
}


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

import java.util.Scanner;
public class Main{
  public static void main(string[] args){
    Scanner scan = new Scanner(System.in);
    int x = new scan.nextInt();
    
    if(x == 2){
      System.out.println(x);
    }
    
    boolean s = false;
    
    while(s == false){
      
      
      for(int i = 2; i < n; i ++){
        if(x % i == 0){
          s = false;
          break;
        }
        s = true;
      }
      
      
      
      x += 1;
    }
    
    System.out.println(x-1);
    
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
  public static void main(string[] args){
                          ^
  symbol:   class string
  location: class Main
Main.java:5: error: package scan does not exist
    int x = new scan.nextInt();
                    ^
Main.java:16: error: cannot find symbol
      for(int i = 2; i < n; i ++){
                         ^
  symbol:   variable n
  location: class Main
3 errors
Language: C

#include <stdio.h>
 
int main(void){
  int x;
  scanf("%d", &x);
  int i, j, flag;
  i = x;
  if(x == 2){
    printf("%d", 3);
    return 0;
  }
  while(true){
    i++;
    flag = 0;
    for(j=2; j<x; j++){
      if(i%j == 0){
        flag = 1;
      }
    }
    if(flag == 0){
      printf("%d", i);
      return 0;
    } 
  }
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: 'true' undeclared (first use in this function)
   12 |   while(true){
      |         ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
   12 |   while(true){
      |         ^~~~
Language: C

#includ <stdio.h>
 
int main(void){
  int x;
  scanf("%d", &x);
  int i, j;
  for(i=x+1; i<100000; i++){
    for(j=2; j<x; j++){
      if(i%j != 0){
        printf("%d", i);
        return 0;
      }
    }
  }
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ <stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d", &x);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includ <stdio.h>
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d", &x);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |         printf("%d", i);
      |         ^~~~~~
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#includ<stdio.h>
 
int main(void){
  int x;
  scanf("%d", &x);
  int i, j;
  for(i=x+1; i<100000; i++){
    for(j=2; j<x; j++){
      if(i%j != 0){
        printf("%d", i);
        return 0;
      }
    }
  }
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d", &x);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includ<stdio.h>
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d", &x);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |         printf("%d", i);
      |         ^~~~~~
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#includ<stdio.h>

int main(void){
  int x;
  scanf("%d", &x);
  int i, j;
  for(i=x+1; i<100000, i++){
    for(j=2; j<x; j++){
      if(i%j != 0){
        printf("%d", i);
        return 0;
      }
    }
  }
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d", &x);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includ<stdio.h>
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d", &x);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:27: error: expected ';' before ')' token
    7 |   for(i=x+1; i<100000, i++){
      |                           ^
      |                           ;
main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |         printf("%d", i);
      |         ^~~~~~
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <string>
#include <cmath>

using namespace std;

bool
isPrime(uint64_t x) {
    for (auto i = 2; i <= sqrt(x); i++) {
        if (x%i==0) return false;
    }
    return true;
}

int
main() {
    uint64_t X, result;
    cin >> X;

    if (X == 2) {
        result = 2;
    } else {
        if (!(X&1)) X++;
        while (1) {
            if (isPrime(X)) {
                result = X;
                break;
            } else {
                X++;
            }
        }
    }

Compiler output:
a.cc:8:9: error: 'uint64_t' was not declared in this scope
    8 | isPrime(uint64_t x) {
      |         ^~~~~~~~
a.cc:4:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    3 | #include <cmath>
  +++ |+#include <cstdint>
    4 | 
a.cc: In function 'int main()':
a.cc:17:5: error: 'uint64_t' was not declared in this scope
   17 |     uint64_t X, result;
      |     ^~~~~~~~
a.cc:17:5: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:18:12: error: 'X' was not declared in this scope
   18 |     cin >> X;
      |            ^
a.cc:21:9: error: 'result' was not declared in this scope
   21 |         result = 2;
      |         ^~~~~~
a.cc:25:24: error: 'isPrime' cannot be used as a function
   25 |             if (isPrime(X)) {
      |                 ~~~~~~~^~~
a.cc:26:17: error: 'result' was not declared in this scope
   26 |                 result = X;
      |                 ^~~~~~
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:16:8: note: to match this '{'
   16 | main() {
      |        ^
Language: C

#include<stdio.h>
#define maxn 100010
int cnt;
int p[maxn], np[maxn];

void init() {
	int i, j;
	for (i = 2; i < maxn; ++i) {
		if (!np[i]) {
			p[++cnt] = i;
			for (j = i + i; j < maxn; j += i)
				np[j] = true;
		}
	}
}
void solve() {
	int n, i;
	scanf("%d", &n);
	for (i = 1; i <= cnt; ++i) {
		if (n <= p[i]) {
			printf("%d", p[i]);
			break;
		}
	}
}
int main() {
	init();
	solve();
	return 0;
}

Compiler output:
main.c: In function 'init':
main.c:12:41: error: 'true' undeclared (first use in this function)
   12 |                                 np[j] = true;
      |                                         ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | #define maxn 100010
main.c:12:41: note: each undeclared identifier is reported only once for each function it appears in
   12 |                                 np[j] = true;
      |                                         ^~~~