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

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

int main(void)
{
        int x,i,j,a;
        double rt;

        scanf("%d",&x);

        a=0;
        for(i=x;i>0;i++){
                rt=sqrt((double)x);
                j=2;
                while((i%j!)=0 && (j<=rt)) j++;

                if(j>rt){
                        printf("%d",i);
                        return 0;
                }
        }
}


Compiler output:
main.c: In function 'main':
main.c:15:27: error: expected ')' before '!' token
   15 |                 while((i%j!)=0 && (j<=rt)) j++;
      |                       ~   ^
      |                           )
main.c:15:29: error: lvalue required as left operand of assignment
   15 |                 while((i%j!)=0 && (j<=rt)) j++;
      |                             ^
Language: C

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

int main(void)
{
        int x,rt,i,j,a;

        scanf("%d",&x);

        a=0;
        for(i=x;i>0;i++){
                exp=sqrt((double)x);
                j=2;
                while((i%j!)=0 && (j<=exp)) j++;

                if(j>exp){
                        printf("%d",i);
                        return 0;
                }
        }
}


Compiler output:
main.c: In function 'main':
main.c:12:20: error: lvalue required as left operand of assignment
   12 |                 exp=sqrt((double)x);
      |                    ^
main.c:14:27: error: expected ')' before '!' token
   14 |                 while((i%j!)=0 && (j<=exp)) j++;
      |                       ~   ^
      |                           )
main.c:14:37: warning: comparison between pointer and integer
   14 |                 while((i%j!)=0 && (j<=exp)) j++;
      |                                     ^~
main.c:14:29: error: lvalue required as left operand of assignment
   14 |                 while((i%j!)=0 && (j<=exp)) j++;
      |                             ^
main.c:16:21: warning: comparison between pointer and integer
   16 |                 if(j>exp){
      |                     ^
Language: C

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

int main(void)
{
        int x,rt,i,j,a;

        scanf("%d",&x);

        a=0;
        for(i=x;i>0;i++){
                exp=(int)sqrt(x);
                for(j=1;j<i;j++){
                        if(exp%j==0) a++;
                }
                if(a==1) {
                        printf("%d",i);
                        return 0;
                }
                else a=0;
        }
}


Compiler output:
main.c: In function 'main':
main.c:12:20: error: lvalue required as left operand of assignment
   12 |                 exp=(int)sqrt(x);
      |                    ^
main.c:14:31: error: invalid operands to binary % (have 'double (*)(double)' and 'int')
   14 |                         if(exp%j==0) a++;
      |                            ~~~^
      |                            |
      |                            double (*)(double)
Language: C

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

int main(void)
{
        int x,rt,i,j,a;

        scanf("%d",&x);

        a=0;
        for(i=x;i>0;i++){
                exp=sqrt(x);
                for(j=1;j<i;j++){
                        if(exp%j==0) a++;
                }
                if(a==1) {
                        printf("%d",i);
                        return 0;
                }
                else a=0;
        }
}


Compiler output:
main.c: In function 'main':
main.c:12:20: error: lvalue required as left operand of assignment
   12 |                 exp=sqrt(x);
      |                    ^
main.c:14:31: error: invalid operands to binary % (have 'double (*)(double)' and 'int')
   14 |                         if(exp%j==0) a++;
      |                            ~~~^
      |                            |
      |                            double (*)(double)
Language: C++

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

int main() {
  int x;
  cin>>x;
  bool con=true;
  while(con){
    int n=sqrt(x);
    for(int i=2;i<=n;i++){
      if(x%i==0){
        break;
      }
      else if(i==n){
        con=false;
        break;
      }
    }
    if(con) x++;
  }
  if(n==2) cout<<2<<endl;
  else cout<<x<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:6: error: 'n' was not declared in this scope
   21 |   if(n==2) cout<<2<<endl;
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INF 100000
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(){
  ll X;
  cin >> X;
  for(ll i=X;i<10004;i++){
    if(IsPrime(i)==true){
      cout << i << endl;
      break;
    }
  }
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'll' was not declared in this scope
   25 |   ll X;
      |   ^~
a.cc:26:10: error: 'X' was not declared in this scope
   26 |   cin >> X;
      |          ^
a.cc:27:9: error: expected ';' before 'i'
   27 |   for(ll i=X;i<10004;i++){
      |         ^~
      |         ;
a.cc:27:14: error: 'i' was not declared in this scope
   27 |   for(ll i=X;i<10004;i++){
      |              ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
  int x ;
  cin >> x ;
  rep2(i,x,100000){
   int ans= 0;
    for(int j=2;j*j<=<i;j++){
      if((i%j)==0) 
      ans= 1 ;
    }
  if(ans==0)
  cout<< i <<endl ;
  break ;
  }
  
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: expected primary-expression before '<' token
   17 |     for(int j=2;j*j<=<i;j++){
      |                      ^
Language: C++

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

vector<long> prime(long N){
    vector<long> p;
    vector<long> ret;
    for(long i=2;i<=N;i++){
        p.push_back(i); 
    }

    while(p.front()<=sqrt(N)){
        long a=p.front();
        ret.push_back(a);
        p.erase(p.begin());
        for(auto itr=p.begin();itr!=p.end();itr++){
            if(*itr%a==0){p.erase(itr);itr--;}
        }
    }
    for(auto i:p){
        ret.push_back(i);
    }
    return ret;
}

int main(){
	long x;cin >> x;
	vector<long> v=prime(x+100);
  	for(itr=v.end()-1;itr!=v.begin();itr--){
    	if(x>*itr){
        	cout << *(itr+1);
          	return 0;
        }
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: 'itr' was not declared in this scope
   28 |         for(itr=v.end()-1;itr!=v.begin();itr--){
      |             ^~~
Language: Java

import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner in=new Scanner(System.in);
    long x,num,i,a;
    boolean b=false;
    x=in.nextInt();
    if(x==2)
    {
      System.out.println("2");
      System.exit(0);
    }
    num=x;
    for(i=num;i>0;i++,num++)
    {
      for(a=2;a<n;a++)
      {
        if(n%a==0)
        {
          b=true;
        }
      }
      if(b==false)
      {
        System.out.println(i);
        System.exit(0);
      }
    }
  }
}
    

Compiler output:
Main.java:18: error: cannot find symbol
      for(a=2;a<n;a++)
                ^
  symbol:   variable n
  location: class Main
Main.java:20: error: cannot find symbol
        if(n%a==0)
           ^
  symbol:   variable n
  location: class Main
2 errors
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:10:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   10 | signed main(){
      |            ^~
a.cc:10:12: note: remove parentheses to default-initialize a variable
   10 | signed main(){
      |            ^~
      |            --
a.cc:10:12: note: or replace parentheses with braces to value-initialize a variable
a.cc:10:14: error: a function-definition is not allowed here before '{' token
   10 | signed main(){
      |              ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:21: note: to match this '{'
    4 | bool is_prime(int x){
      |                     ^
Language: C

x = int(input())
z = 0
while(z == 0):
    if x > 1:
        # check for factors
        for i in range(2, x):
            if (x % i) == 0:

                x = x+1
        else:
            print(x)
            z = 1

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | x = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | x = int(input())
      |     ^~~
main.c:5:11: error: invalid preprocessing directive #check
    5 |         # check for factors
      |           ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long 
using namespace std;
bool prime(int x){
  int key=0;
  rep2(i,2,sqrt(x)+1) if(x%i==0) key=1;
  if(key==0) return true;
  else return false;
}
  
int main() {
  int x;
  cin >>x;
  int ans;
  rep(i,1000000) {
    if(i>=x&&prime(i)==true) {
      ans=i;
      break;
    }
  }
    cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:14:8: error: 'i' was not declared in this scope
   14 |   rep2(i,2,sqrt(x)+1) if(x%i==0) key=1;
      |        ^
a.cc:14:3: error: 'rep2' was not declared in this scope; did you mean 'rep'?
   14 |   rep2(i,2,sqrt(x)+1) if(x%i==0) key=1;
      |   ^~~~
      |   rep
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;

const int INF = 1001001001;

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


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

    ll k;
    ll ans = 0;
    cin >> k;
    ll ans = k;
    while(!is_prime(ans)) ans++;
    cout << k << endl;

    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:8: error: redeclaration of 'll ans'
   27 |     ll ans = k;
      |        ^~~
a.cc:25:8: note: 'll ans' previously declared here
   25 |     ll ans = 0;
      |        ^~~
Language: C++

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

int main() {
  int X;
  cin>>X;
  
  while(true) {
    
    if(for(int i=2;i<X;i++) {
      X%i == 0}){
      cout<<X<<endl;
    }
    
    else {
      X++;
    }
  }
    return 0;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected primary-expression before 'for'
   10 |     if(for(int i=2;i<X;i++) {
      |        ^~~
a.cc:10:8: error: expected ')' before 'for'
   10 |     if(for(int i=2;i<X;i++) {
      |       ~^~~
      |        )
a.cc:10:20: error: 'i' was not declared in this scope
   10 |     if(for(int i=2;i<X;i++) {
      |                    ^
a.cc:11:16: error: expected primary-expression before ')' token
   11 |       X%i == 0}){
      |                ^
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
typedef long long ll;

vector<ll> primevector(ll N){
    vector<ll> data(1);
    data[0]=2;
//素数を追加していく
    for(ll i=3;i<N;i++){
        ll cnt=0;
        for(ll j=0;j<data.size();j++){
            if(i%data[j]==0){cnt++;break;}
        }
        if(cnt==0){data.push_back(i);}
    }
    return data;
}

int main() {
  ll X;
  cin>>X;
  vector<ll> prime;
  prime=primevector(X);
  bool flag=true; 
  while(flag){
    flag=false;
    rep0(i,prime.size()){if(X%prime[i]==0){flag=true;}}
    if(flag){break;}
    if(1-flag2){X++; flag=true;}
  }
  cout<<X<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:10: error: 'flag2' was not declared in this scope; did you mean 'flag'?
   32 |     if(1-flag2){X++; flag=true;}
      |          ^~~~~
      |          flag
Language: C++

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

int main() {

long long X;
cin >> X;
long long res = X;
while(!is_prime(res))res++;

cout << res << endl;
}



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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'is_prime' was not declared in this scope
   10 | while(!is_prime(res))res++;
      |        ^~~~~~~~
Language: C++

#include<stdio.h>
bool prime(int x){
  if(x<=1){
    return false;
  }
  for(int loop=2;loop*loop<=x;loop++){
    if(x%i==0){
      return false;
    }
  }
  return true;
}
int main(void){
  int x;
  int p=x;
  while(!prime(p)){
    p++;
  }
  printf("%d\n",p);
  return 0;
}

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:7:10: error: 'i' was not declared in this scope
    7 |     if(x%i==0){
      |          ^
Language: C++

/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

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

#define io ios_base::sync_with_stdio(false)
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vll vector<long long>
#define pb push_back
#define mod 1000000007
#define pii pair<int, int>
#define PI 2*acos(0.0)

bool isprime(ll n)
{
    for(int i = 3; i*i <= n; i+=2)
        if(n%i == 0)
            return 0;
    return 1;
}

int main()
{
    io;
  
        ll n;
        cin>>n;
        if(n<2)
        {
            cout << 2 <<"\n";
            continue;
        }
        if(n&1)
            n+=2;
        else
            n++;
        ll j;
        for(j = n; j<2*n; j+=2)
            if(isprime(j))
                break;
        cout << j <<"\n";
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: continue statement not within a loop
   35 |             continue;
      |             ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;

vector<bool> sieve(int n) {
    int p = 0;
    vector<bool> is_prime(n + 1, true);
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i < n; i++) {
        if (is_prime[i]) {
            prime[p++] = i;
            for (int j = i * 2; j < n; j += i) is_prime[j] = false;
        }
    }

    return is_prime;
}

int main()
{
    int X;
    cin >> X;
    int ans = 0;
    vector<bool> is_prime = sieve(X);
    repd(i, 1, X + 1) {
        if (is_prime[i]) ans = i;
    }

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

Compiler output:
a.cc: In function 'std::vector<bool> sieve(int)':
a.cc:18:13: error: 'prime' was not declared in this scope
   18 |             prime[p++] = i;
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;

vector<bool> sieve(int n) {
    int p = 0;
    vector<bool> is_prime(n + 1, true);
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i < n; i++) {
        if (is_prime[i]) {
            prime[p++] = i;
            for (int j = i * 2; j < n; j += i) is_prime[j] = false;
        }
    }

    return is_prime;
}

int main()
{
    int X;
    cin >> X;
    int ans = 0;
    vector<bool> is_prime = sieve(X);
    repd(i, X + 1) {
        if (is_prime[i]) ans = i;
    }

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

Compiler output:
a.cc:32:18: error: macro "repd" requires 3 arguments, but only 2 given
   32 |     repd(i, X + 1) {
      |                  ^
a.cc:3:9: note: macro "repd" defined here
    3 | #define repd(i,a,b) for (int i=(a);i<(b);i++)
      |         ^~~~
a.cc: In function 'std::vector<bool> sieve(int)':
a.cc:18:13: error: 'prime' was not declared in this scope
   18 |             prime[p++] = i;
      |             ^~~~~
a.cc: In function 'int main()':
a.cc:32:5: error: 'repd' was not declared in this scope
   32 |     repd(i, X + 1) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;

bool is_prime(100001);
int sieve(int n) {
    int p = 0;
    vector<bool> is_prime(n + 1, true);
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i < n; i++) {
        if (is_prime[i]) {
            prime[p++] = i;
            for (int j = i * 2; j < n; j += i) is_prime[j] = false;
        }
    }

    return p;
}

int main()
{
    int X;
    cin >> X;
    int ans = 0;
    sieve(X);
    repd(i, X + 1) {
        if (is_prime[i]) ans = i;
    }

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

Compiler output:
a.cc:33:18: error: macro "repd" requires 3 arguments, but only 2 given
   33 |     repd(i, X + 1) {
      |                  ^
a.cc:3:9: note: macro "repd" defined here
    3 | #define repd(i,a,b) for (int i=(a);i<(b);i++)
      |         ^~~~
a.cc: In function 'int sieve(int)':
a.cc:19:13: error: 'prime' was not declared in this scope
   19 |             prime[p++] = i;
      |             ^~~~~
a.cc: In function 'int main()':
a.cc:33:5: error: 'repd' was not declared in this scope
   33 |     repd(i, X + 1) {
      |     ^~~~
Language: C++

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

signed main(){
  int N;
  cin>>N;
  int A=N;
  while(!primeN(A))A++;
  cout<<A<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin>>N;
      |   ^~~
a.cc:14:3: error: 'cout' was not declared in this scope
   14 |   cout<<A<<endl;
      |   ^~~~
a.cc:14:12: error: 'endl' was not declared in this scope
   14 |   cout<<A<<endl;
      |            ^~~~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int X;
  scanf("%d", &X);
  int a=0;
  bool t=false;
  for (int i=X; i<=2X;i++){
    for(int j=2; j<=sqrt(i); j++){
      if(i%j==0) a=i;
      bool t=true;
      break;
    }
    if (t) break;
  }
  cout<<a<<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: unable to find numeric literal operator 'operator""X'
    9 |   for (int i=X; i<=2X;i++){
      |                    ^~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int X;
  scanf("%d", &X);
  int a=0;
  bool t=false;
  for (int i=X, i<=2X,i++){
    for(int j=2, j<=sqrt(i), j++){
      if(i%j==0) a=i;
      bool t=true;
      break;
    }
    if (t) break;
  }
  cout<<a<<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '<=' token
    9 |   for (int i=X, i<=2X,i++){
      |                  ^~
      |                  ;
a.cc:9:18: error: expected primary-expression before '<=' token
    9 |   for (int i=X, i<=2X,i++){
      |                  ^~
a.cc:9:20: error: unable to find numeric literal operator 'operator""X'
    9 |   for (int i=X, i<=2X,i++){
      |                    ^~
a.cc:9:26: error: expected ';' before ')' token
    9 |   for (int i=X, i<=2X,i++){
      |                          ^
      |                          ;
a.cc:10:19: error: expected ';' before '<=' token
   10 |     for(int j=2, j<=sqrt(i), j++){
      |                   ^~
      |                   ;
a.cc:10:19: error: expected primary-expression before '<=' token
   10 |     for(int j=2, j<=sqrt(i), j++){
      |                   ^~
a.cc:10:33: error: expected ';' before ')' token
   10 |     for(int j=2, j<=sqrt(i), j++){
      |                                 ^
      |                                 ;
Language: C++

#include<iostream>
using namespace std;
bool prime(int n){
	int flag=0;
  if(n==2 || n==3){
    return true;
  }
  else{
  	for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        flag=1;
        break;
      }
    }
  }
  	if(flag==0){
		return true;
    }
  else {
    return false;
  }
}
int main(){
  int N;
  cin>>N;
  while(!prime(N)){
    N++;
  }
  cout<<N<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:9:24: error: 'sqrt' was not declared in this scope
    9 |         for(int i=2;i<=sqrt(n);i++){
      |                        ^~~~
Language: C++

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

int main() {
  int N;
  cin>>N;
  while(1==1){
    int a=0;
    for(i=2;i<=sqrt(N);i++){
      if(N%i==0){
        a++;
        break;
      }
    }
    if(a==1){
      N++;
      continue;
    }
    else{
      cout<<N<<endl;
      break;
    }
  }
}


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

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

int main(){
	int n;
	cin >> n;
	if(n==1||n==2){
		cout << 2 << endl;
		return;
	}
	while(true){
		int count=0;
		rep(i,sqrt(n)+1){
			if(n%i==0)count++;
		}
		if(count==0){
			cout << n << endl;
			break;
		}
		n++;
	}
}


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

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

int main(){
	int n;
	cin >> n;
	if(n==1){
		cout << 2 << endl;
		return;
	}
	while(true){
		int count=0;
		rep(i,sqrt(n)+1){
			if(n%i==0)count++;
		}
		if(count==0){
			cout << n << endl;
			break;
		}
		n++;
	}
}


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

import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		
		if (x == 2) {
			System.out.println(2);
			return;
		}
		
		int idx = 0;
		int[] p = new int[100010];
		p[idx++] = 2;
		p[idx++] = 3;
		
		for (int n = 3; n <= 100009; n += 2) {
			boolean flg = false;
			for (int i = 1; p[i] * p[i] <= n; i++) {
				if (n % p[i] == 0) {
					flg = true;
					break;
				}
			}
			
			if (!flg) {
				p[idx++] = n;
				if (n >= x) {
					System.out.println(n);
					return;
				}
			}
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;

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

int main () {
    int x;
    cout << x;
    int p = x;
    while(!is_prime(p)) p++;
    cout << p;
}

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:11:8: error: 'i' was not declared in this scope
   11 |     if(i <= 1) return false;
      |        ^
a.cc:17:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   17 | int main () {
      |          ^~
a.cc:17:10: note: remove parentheses to default-initialize a variable
   17 | int main () {
      |          ^~
      |          --
a.cc:17:10: note: or replace parentheses with braces to value-initialize a variable
a.cc:17:13: error: a function-definition is not allowed here before '{' token
   17 | int main () {
      |             ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:10:21: note: to match this '{'
   10 | bool is_prime(int p){
      |                     ^
Language: C++

def isPrime(x):
    if x < 2:
        return False
    for i in range(2, int(pow(x, 0.5)+1)):
        if x%i==0:
            return False
    return True

X = int(input())

while True:
    if isPrime(X):
        print(X)
        break
    else:
        X += 1


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def isPrime(x):
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
bool exprime(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 a;
  cin>>a;
  int i=a;
  for(int i=a;;i++){
    bool ex;
    ex=exprime(i);
    if(ex==true){
      cout<<i<<endl;
      return 0;
    }
  }
}

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

#include <iostream>
#include <string>
#include <vector>
using namespace std;
 
void func149c(){
    int N;
    cin >> N;
 
    while (!prime(N)) N++;
    cout << N << "\n";
}
 
int main()
{
  func149c();
  return 0;
}

Compiler output:
a.cc: In function 'void func149c()':
a.cc:10:13: error: 'prime' was not declared in this scope
   10 |     while (!prime(N)) N++;
      |             ^~~~~
Language: C++


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

void func149c(){
    int N;
    cin >> N;

    while (!prime(N)) N++;
    cout << N << "\n";
}

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

Compiler output:
a.cc: In function 'void func149c()':
a.cc:11:13: error: 'prime' was not declared in this scope
   11 |     while (!prime(N)) N++;
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
    long long n,b;
   cin>>n;
   b=0;
   rep(i,n/2){
   if(n%(i+2)==0)
     n++;
     b=0;
   else
     b++;
     
    if(b==n/2)
      break;
   }
  cout<<n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: 'else' without a previous 'if'
   12 |    else
      |    ^~~~
Language: C++

#include <iostream>
using namespace std;

int main () {
  int x;
  cin >> x;
  
  while(true) {    
    for (int i = 2; i < x; i++) {
      if (x % i == 0) {
        x++;
        break;
      } else if (i == x - 1) {
        cout << x << endl;
        return;
      }
    }
  }
}
    


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

#include <bits/stdc++.h>
using namespace std;
bool prime(int x){
  
  for(int i=2;i<x;i++){
    if(x%i==0){
      prime(x)=false;
      return 0;
    }
  }
  prime(x)=true;
  return prime(x);
}
int main(){
  int x;
  cin>>x;
  while(!prime(x)){
    x++;
  }
  cout<<x<<endl;

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:7:12: error: lvalue required as left operand of assignment
    7 |       prime(x)=false;
      |       ~~~~~^~~
a.cc:11:8: error: lvalue required as left operand of assignment
   11 |   prime(x)=true;
      |   ~~~~~^~~
a.cc: In function 'int main()':
a.cc:20:17: error: expected '}' at end of input
   20 |   cout<<x<<endl;
      |                 ^
a.cc:14:11: note: to match this '{'
   14 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int prime(int n){
  for(int i=2;i<=n;i++){
    if((n+1)%i==0){
      n++;
      prime(n)
    }
  }
  return n;
}
int main(){
  int n;
  cin>>n;
  int ans=prime(n);
  cout<<ans<<endl;
  
  
}

Compiler output:
a.cc: In function 'int prime(int)':
a.cc:8:15: error: expected ';' before '}' token
    8 |       prime(n)
      |               ^
      |               ;
    9 |     }
      |     ~
Language: C++

import math

n = input()
def is_prime(n)
    for i in range(2, math.sqrt(n)+1)
        if n%i == 0:
            return True
        else:return False
for i in range(n,2*10**5):
    if is_prime(i) == True:
        print(i)
        exit()

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
bool 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;
  for(int i=x;;i++){
  bool primeex=prime(i);
  if(primeex==true)
    cout<<i<<endl;
  }
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin >> a;
  int m;
  for(int i = 0;i < 10000;i++){
    int g;
    g = 1;
    for(int j = 2;j < min(a-1,1000);j++){
      if( (a+i) % j == 0){
        g = 0;}
    }
    if(g == 1){m = a+i;
              break;}
  }

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

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

vector<bool> getPrime(int N);

int main(void) {
    int X;
    cin>>X;
    vector<bool> vc = getPrime(X);
    int c = count(vc.begin(), vc.end(), true);
    if (vc.at(X)) {
        cout << X << endl;
    } else {
        int result = X + 1;
        vector<bool> tmp = getPrime(result);
        while (c == count(tmp.begin(), tmp.end(), true)) {
            tmp = getPrime(++result);
        }
        cout << result << endl;
    }
    return 0;
}

// エラトステネスの篩
vector<bool> getPrime(int N) {
    vector<bool> p = vector<bool>(N + 1, true);
    p.at(0) = false;
    p.at(1) = false;
    for (int i = 2; i * i <= N; i++) {
        for (int j = 2; i * j <= N; j++) {
            p.at(i * j) = false;
        }
    }
    return p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'count' was not declared in this scope
   11 |     int c = count(vc.begin(), vc.end(), true);
      |             ^~~~~
Language: C

#include<stdio.h>
int main(void){
  int n,i,a[100000],j;
  scanf("%d",&n);
  for(i=0;i<100000;i++){
    a[i]=0;
  }
  a[0]=1;
  for(i=2;i<50000;i++){
    for(j=2;i*j<=100000;j++){
      if(p[i*j-1]==0) a[i*j-1]=1;
    }
  }
  for(i=0;i<100000;i++){
    if(a[i]==0&&a[i]>=n){
      printf("%d",i+1); 
      return 0;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:10: error: 'p' undeclared (first use in this function)
   11 |       if(p[i*j-1]==0) a[i*j-1]=1;
      |          ^
main.c:11:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
  int x;
  cin>>x;
  while(1){
    bool ok=true;
    for(int i; i=2;i<x; ++i){
      if(x%i==0){
        ok=false;
        break;
      }
    }
    if(ok) break;
    ++x;
  }
  cout<<x<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ')' before ';' token
   11 |     for(int i; i=2;i<x; ++i){
      |        ~              ^
      |                       )
a.cc:11:27: error: 'i' was not declared in this scope
   11 |     for(int i; i=2;i<x; ++i){
      |                           ^
Language: C++

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
  int x;
  cin>>x;
  while(1){
    bool ok=true
    for(int i=2;i<x; ++i){
      if(x%i==0){
        ok=false;
        break;
      }
    }
    if(ok) break;
    ++x;
  }
  cout<<x<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
   11 |     for(int i=2;i<x; ++i){
      |     ^~~
a.cc:11:17: error: 'i' was not declared in this scope
   11 |     for(int i=2;i<x; ++i){
      |                 ^
Language: C++

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
//* vamsicool007    You are never wrong to do the right thing    vamsicool007 *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
#include<bits/stdc++.h>
using namespace std;
#define flash ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define int long long
typedef long long ll;
typedef long double ld;
const int mod = 1000000007;
bool isPrime(ll n){for(ll i=2;i*i<=n;++i){if(n%i==0){return false;}}return true;}
ll factorial(ll n){return (n==1 || n==0) ? 1:n*factorial(n-1);}
ll power(ll x,ll y){ll res=1;x=x;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res%mod;}
ll ncr(ll n,ll r){ll res=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){res*=(n-i);res/=(i+1);}return res;}
ll gcd(ll a,ll b){if (a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (a/gcd(a,b)*b);}
ll max(ll a,ll b){ll ans=a>b?a:b;return ans;}
ll min(ll a,ll b){ll ans=a<b?a:b;return ans;}
 
signed main()
{
    int t=1;
    //cin>>t;
    while(t--)
    {
    	vactor<int>v;
    	for(int i=2;i<100005;i++)
    	{
    		if(isPrime(i))
    			v.pb(i);
    	}
    	int x;
    	cin>>x;
    	int j=lower_bound(v.begin(),v.end(),x)-v.begin();
    	cout<<v[j];
    }
	return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'vactor' was not declared in this scope
   32 |         vactor<int>v;
      |         ^~~~~~
a.cc:13:13: error: expected primary-expression before 'long'
   13 | #define int long long
      |             ^~~~
a.cc:32:16: note: in expansion of macro 'int'
   32 |         vactor<int>v;
      |                ^~~
a.cc:36:25: error: 'v' was not declared in this scope
   36 |                         v.pb(i);
      |                         ^
a.cc:40:27: error: 'v' was not declared in this scope
   40 |         int j=lower_bound(v.begin(),v.end(),x)-v.begin();
      |                           ^
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <iterator>
#include <cmath>
#include <map>
using namespace std;

void func149c() {
  int x;
  cin >> x;
  for (int i = 2; i < x i++) {
    if (x%i == 0) {
      //xが割り切れちゃったら次の数字へ
      //iもリセット
      x++;
      i = 1;
    }
  }
  cout << x << "\n";
}



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

Compiler output:
a.cc: In function 'void func149c()':
a.cc:14:24: error: expected ';' before 'i'
   14 |   for (int i = 2; i < x i++) {
      |                        ^~
      |                        ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool isprime(int k){
    for(int i=1;i*i<=x;i++){
        if(k%i==0)return false;
    }
    return true;
}
int main() {
long long x;
cin >> x;
for(int j=x;j<10000000;j++){
    if(isprime(j)){cout <<j;
    break;}
}
}


Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:4:22: error: 'x' was not declared in this scope
    4 |     for(int i=1;i*i<=x;i++){
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool isprime(int x){
    for(int i=1;i*i<=x;i++){
        if(x%i==0)return true;
    }
    return false;
}
int main() {
long long x;
cin >> x;
for(int i=x;i++){
    if(isprime(i))cout <<i;
    return 0;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before ')' token
   12 | for(int i=x;i++){
      |                ^
      |                ;
Language: C

#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int X, ans;
  cin >> X;
  if(X==2) cout << 2 << endl;
  else {
    if(X%2==0) X++;
    for(X; X<=100003; X+=2) {
      int jadge=1;
      for(int j=3; j<X; j++) {
        if(X%j==0) jadge=0;
      }
      if(jadge==1) {
        ans=X;
      	break;
      }
    }
  	cout << ans << 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>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int X, ans;
  cin >> X;
  if(X==2) cout << 2 << endl;
  else {
    if(X%2==0) X++;
    for(X; X<100003; X+=2) {
      int jadge=1;
      for(int j=3; j<X; j++) {
        if(X%j==0) jadge=0;
      }
      if(jadge==1) {
        ans=X;
      	break;
      }
    }
  	cout << ans << 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 <iostream>
#include <string>
#include <algorithm>
#include <vector>


using namespace std;

bool isPrime(int x)
{
  int n = (int) sqrt((double)x) ;

  for ( int i = 2; i < n; ++i )
    if ( x % i == 0 ) return false;
  return true;
}

int main()
{
  int x;
  cin >> x;
    
  for ( int i=x; true; ++i )
  {
    if( isPrime(i) )
    {
      cout << i;
      return 0;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'bool isPrime(int)':
a.cc:11:17: error: 'sqrt' was not declared in this scope
   11 |   int n = (int) sqrt((double)x) ;
      |                 ^~~~
Language: C++

#include<iostream>

using namespace std;

/*-----素数判定関数   エラー：-1 , 素数でない：0 , 素数：1-----*/
int isPrime(int x) {
	
	if (x < 2) {
		return -1;
	}

	int root_x = sqrt(x);

	for (int i = root_x; i > 1; --i) 
	{
		if (x % i == 0) return 0;
	}

	return 1;
}

int main() {

	int X;
	cin >> X;

	int count = 0;
	bool prime = false;

	while (isPrime(X + count) == 0)
	{
		count++;
	}

	cout << X + count;

	return 0;
}

Compiler output:
a.cc: In function 'int isPrime(int)':
a.cc:12:22: error: 'sqrt' was not declared in this scope
   12 |         int root_x = sqrt(x);
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool prime(int num);
int main(){
    long long X;
    cin >> X;
    while(true){
        if(prime(X)){
            cout << X << endl;
            return 0;
        }
        X++;
    }
}

bool prime(long long num){
    for(long long i=1;i<num-1;i++){
        bool flag=num%(num-i);
        if(!flag){
            return false;
        }
    }
    return true;
}

Compiler output:
/usr/bin/ld: /tmp/ccENzJbB.o: in function `main':
a.cc:(.text+0x25): undefined reference to `prime(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>

using namespace std;

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

void main()
{
    int n;
    cin >> n;

    if(n != 2){
        if(n % 2 == 0) ++n;
        while(!isPrime(n)) n += 2;
    }

    cout << n;
    return 0;
}

Compiler output:
a.cc:12:1: error: '::main' must return 'int'
   12 | void main()
      | ^~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc= sc.nextInt();
    int a =sc.nextInt();
    int s =0;
    if((a==2)||(a==3)){System.out.println(a);}else{
    for(int j =a;j<100000;j++){
      for(int i=2;i<j;i++){
      int L = a%i;
      if(L==0){break;}
      s = s+1;}
      if(s==j){break;}
    }
      System.out.println( s );
    }
  }
}

Compiler output:
Main.java:4: error: incompatible types: int cannot be converted to Scanner
    Scanner sc= sc.nextInt();
                          ^
1 error
Language: C++

#include "pch.h"
#include <iostream>
#include <vector>

using namespace std;



bool is_prime(int x)
{
  if (x <= 1) return false;
  if (x == 2) return true;

  if (x % 2 == 0)return false;

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

  return true;
}


void next_prime()
{
  int x;
  cin >> x;

  int prime = x;
  while (!is_prime(prime)) prime++;

  cout << prime << "\n";
}


int factorial(int n)
{
  int fact = 1;
  for (int i = n; i > 0; i--) fact *= i;
  return fact;
}


int calc_order(int n, vector<int> x)
{
  int cnt = 0;
  for (int i = 0; i < n; i++)
  {
    cnt += (x[i] - 1) * factorial(n - 1 - i);
    for (int j = i + 1; j < n; j++) {
      if (x[j] > x[i]) x[j]--;
    }
  }
  return cnt;
}


void count_order()
{
  int n;
  cin >> n;

  vector<int> p(n);
  vector<int> q(n);
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < n; i++) cin >> q[i];

  int p_cnt = 0, q_cnt = 0;
  p_cnt = calc_order(n, p);
  q_cnt = calc_order(n, q);

  cout << abs(p_cnt - q_cnt);
}




int main()
{
  next_prime();
  //count_order();
}


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

c=int(input())
import math

serach_number = 100000


def sieve_of_eratosthenes(target, c):
    k=0
    dest = int(math.sqrt(target))
    target_list = list(range(2, target + 1))
    prime_list = []

    while True:
        num_min = min(target_list)
        if num_min >= dest:
            prime_list.extend(target_list)
            break
        prime_list.append(num_min)
        if num_min>=c:
            k=1
        if k==1:
            print(num_min)
            return
        i = 0

        while True:
            if i >= len(target_list):
                break
            elif target_list[i] % num_min == 0:
                target_list.pop(i)
            i += 1




sieve_of_eratosthenes(serach_number, c)


Compiler output:
a.cc:1:1: error: 'c' does not name a type
    1 | c=int(input())
      | ^
Language: C++

x=int(input())
import math

serach_number = 100000


def sieve_of_eratosthenes(target):
    k=0
    dest = int(math.sqrt(target))
    target_list = list(range(2, target + 1))
    prime_list = []

    while True:
        num_min = min(target_list)
        if num_min >= dest:
            prime_list.extend(target_list)
            break
        prime_list.append(num_min)
        if num_min>=x:
            k=1
        if k==1:
            print(num_min)
            return
        i = 0

        while True:
            if i >= len(target_list):
                break
            elif target_list[i] % num_min == 0:
                target_list.pop(i)
            i += 1




sieve_of_eratosthenes(serach_number)


Compiler output:
a.cc:1:1: error: 'x' does not name a type
    1 | x=int(input())
      | ^
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		sc.close();
		int a = 1;

		while (a != 0) {
			a=0;
			for (int i = 2; i <= X / 2; i++) {
				if (X % i == 0) {
					a++;
				}
			}
			if (a != 0) {
				X++;
			}
		}
		System.out.println(X);
	}
}

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

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

typedef long long 			ll;
typedef unsigned long long 	ull;

const int N = 100 + 20;
const int MAXN = 100 * 1000 + 20;

//ll a[N];

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
	ll x;
	bool flag = false;
	cin >> x;
	while (!flag) {
		for (int i = 2; i <= n; i++) {
			if (!(x % i) && i < x)
				break;
			if (i == x) {
				cout << x << endl;
				flag = true;
			}
		}
		x++;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:38: error: 'n' was not declared in this scope
   18 |                 for (int i = 2; i <= n; i++) {
      |                                      ^
Language: C++

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

int main() {
  int n;
  bool ans=true;
  cin>>n;
  if(n==2)cout<<2<<endl;
  else{
  for(int i=n;i<n*2;i++){
    ans=true;
    for(int j=2;j<i;j++){
      if(i%j==0)ans=false;
      break;
    }
    if(ans){
      cout<<i<<endl;
    break;
    }
  }
}


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

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


bool isPrime(int n) 
{ 
	// Corner cases 
	if (n <= 1) return false; 
	if (n <= 3) return true; 
	
	// This is checked so that we can skip 
	// middle five numbers in below loop 
	if (n%2 == 0 || n%3 == 0) return false; 
	
	for (int i=5; i*i<=n; i=i+6) 
		if (n%i == 0 || n%(i+2) == 0) 
		return false; 
	
	return true; 
} 


int nextPrime(int N) 
{ 

	
	if (N <= 1) 
		return 2; 

	int prime = N; 
	bool found = false; 

	
	while (!found) { 
		prime++; 

		if (isPrime(prime)) 
			found = true; 
	} 

	return prime; 
} 


int main() 
{ 
	int N = 3; 

	cout << nextPrime(N); 

	return 0; 
} 


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