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

import java.util.*;
public class Main{
	public static void main(String [] args){
    	Scanner scan = new Scanner(System.in);
      	int x = scan.nextInt();
 		int [] arr = new int[10e5+10];
      	int size = arr.length();
      arr[1]=1;
      arr[2]=1;
      arr[3]=1;
      	for(int i=4;i<size;i++){
          boolean isPrime=true;
        	for(int j=2;j<=Math.sqrt(i);j++){
            	if(i%j==0){
                  isPrime=false;
                  break;
                }
            }
          if(isPrime){
          arr[i]=1;
          }
        }
      	for(int i = x;i<size;i++){
        	if(arr[i]==1){
            System.out.println(i);
              break;
            }
        }
      	
    }
}


Compiler output:
Main.java:6: error: incompatible types: possible lossy conversion from double to int
 		int [] arr = new int[10e5+10];
 		                         ^
Main.java:7: error: cannot find symbol
      	int size = arr.length();
      	              ^
  symbol:   method length()
  location: variable arr of type int[]
2 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String [] args){
    	Scanner scan = new Scanner(System.in);
      	int x = scan.nextInt();
 		int [] arr = new int[10e5+10];
      	int size = arr.length();
      arr[1]=1;
      arr[2]=1;
      arr[3]=1;
      	for(int i=4;i<size;i++){
          boolean isPrime=true;
        	for(int j=2;j<=Math.sqrt(i);j++){
            	if(i%j==0){
                  isPrime=false;
                  break;
                }
            }
          if(isPrime){
          arr[i]=1;
          }
        }
      	for(int i = x;i<size;i++{
        	if(arr[i]==1){
            System.out.println(i);
              break;
            }
        }
      	
    }
}


Compiler output:
Main.java:23: error: ')' expected
      	for(int i = x;i<size;i++{
      	                        ^
1 error
Language: C++

//
//  main.cpp
//  3
//
//  Created by RISHAV SINGH MEHTA on 29/12/19.
//  Copyright © 2019 RISHAV SINGH MEHTA. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <math.h>
#define ll long long
using namespace std;
bool prime[100007]={false};
void SieveOfEratosthenes( ll int n)
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.
    
    memset(prime, true, sizeof(prime));
    
    for (ll  int p=2; p*p<=n; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (ll int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    
    // Print all prime numbers
    
}

int main(int argc, const char * argv[]) {
    // insert code here...
    ll int T,N,i,j,k=0,l;
    cin>>N;i=100007;
   
    SieveOfEratosthenes(i);
   
 
    for (i=N; i<100007; i++) {
        if ( prime[i] == true ) {
            k=i;
            break;
        }
    }
    cout<<k;
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'void SieveOfEratosthenes(long long int)':
a.cc:21:5: error: 'memset' was not declared in this scope
   21 |     memset(prime, true, sizeof(prime));
      |     ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include <math.h>
  +++ |+#include <cstring>
   12 | #define ll long long
Language: C++

//
//  main.cpp
//  3
//
//  Created by RISHAV SINGH MEHTA on 29/12/19.
//  Copyright © 2019 RISHAV SINGH MEHTA. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <math.h>
#define ll long long
using namespace std;
bool prime[100007]={false};
void SieveOfEratosthenes(int n)
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.
    
    memset(prime, true, sizeof(prime));
    
    for (int p=2; p*p<=n; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    
    // Print all prime numbers
    
}

int main(int argc, const char * argv[]) {
    // insert code here...
    ll int T,N,i,j,k=0,l;
    cin>>N;i=100007;
   
    SieveOfEratosthenes(i);
   
 
    for (i=N; i<100007; i++) {
        if ( prime[i] == true ) {
            k=i;
            break;
        }
    }
    cout<<k;
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'void SieveOfEratosthenes(int)':
a.cc:21:5: error: 'memset' was not declared in this scope
   21 |     memset(prime, true, sizeof(prime));
      |     ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include <math.h>
  +++ |+#include <cstring>
   12 | #define ll long long
Language: C++

//
//  main.cpp
//  3
//
//  Created by RISHAV SINGH MEHTA on 29/12/19.
//  Copyright © 2019 RISHAV SINGH MEHTA. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <math.h>
#define ll long long
using namespace std;
bool prime[200000]={false};
void SieveOfEratosthenes(int n)
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.
    
    memset(prime, true, sizeof(prime));
    
    for (int p=2; p*p<=n; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    
    // Print all prime numbers
    
}

int main(int argc, const char * argv[]) {
    // insert code here...
    ll int T,N,i,j,k=0,l;
    cin>>N;i=200007;
   
    SieveOfEratosthenes(i);
   
 
    for (i=N; i<200000; i++) {
        if ( prime[i] == true ) {
            k=i;
            break;
        }
    }
    cout<<k;
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'void SieveOfEratosthenes(int)':
a.cc:21:5: error: 'memset' was not declared in this scope
   21 |     memset(prime, true, sizeof(prime));
      |     ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include <math.h>
  +++ |+#include <cstring>
   12 | #define ll long long
Language: C++

//
//  main.cpp
//  3
//
//  Created by RISHAV SINGH MEHTA on 29/12/19.
//  Copyright © 2019 RISHAV SINGH MEHTA. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <math.h>
#define ll long long
using namespace std;
bool prime[400000]={false};
void SieveOfEratosthenes(int n)
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.
    
    memset(prime, true, sizeof(prime));
    
    for (int p=2; p*p<=n; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    
    // Print all prime numbers
    
}

int main(int argc, const char * argv[]) {
    // insert code here...
    ll int T,N,i,j,k=0,l;
    cin>>N;i=400007;
   
    SieveOfEratosthenes(i);
   
 
    for (i=N; i<1000000; i++) {
        if ( prime[i] == true ) {
            k=i;
            break;
        }
    }
    cout<<k;
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'void SieveOfEratosthenes(int)':
a.cc:21:5: error: 'memset' was not declared in this scope
   21 |     memset(prime, true, sizeof(prime));
      |     ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include <math.h>
  +++ |+#include <cstring>
   12 | #define ll long long
Language: Java

import java.util.Scanner;

public class asuka {

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

        long X = sc.nextLong();

        int i =0;
        loop : while(true){
            X = X+i;
            for(int k=2; k<X;k++){
                if(X%k==0){
                    break;
                }
                if(k == X-1){
                    System.out.println(X);
                    break loop;
                }
            }
            i++;
        }
    }


}


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

#include <iostream>
using namespace std;
 
long n;
bool check;
 
int main()
{
	cin >> n;
	while (true)
	{
		check = true;
		if ((n == 2) || (n == 3)) { check = false; }
		else if ((n == 1) || (n % 2 == 0) || (n % 3 == 0)) { check = false; }
		int k = -1;
		while (k < sqrt(n))
		{
			k += 6;
			if ((n % k == 0) || n % (k + 2) == 0) { check = false; break; }
		}
		n++;
		if (check == true) { break; }
	}
	cout << n-1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: 'sqrt' was not declared in this scope
   16 |                 while (k < sqrt(n))
      |                            ^~~~
Language: C++

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

int num; cin >> num;

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 num; cin >> num;

    int p = num;
    while(!IsPrime(p)) p++;

    cout << @ << endl;
    return 0;
}


Compiler output:
a.cc:32:13: error: stray '@' in program
   32 |     cout << @ << endl;
      |             ^
a.cc:4:10: error: 'cin' does not name a type
    4 | int num; cin >> num;
      |          ^~~
a.cc: In function 'int main()':
a.cc:32:15: error: expected primary-expression before '<<' token
   32 |     cout << @ << endl;
      |               ^~
Language: Java

import java.util.Scanner;

/**
 * Next Prime
 */
public class C {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int X = sc.nextInt();

            for (int i = X;; i++) {
                if (isPrime(i)) {
                    System.out.println(i);
                    return;
                }
            }
        }
    }

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

}


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

#include<stdio.h>

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

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

	int p = x;
	
	while (!so(p))p++;

	printf("%d", p);
	
}

Compiler output:
main.c: In function 'so':
main.c:5:27: error: 'false' undeclared (first use in this function)
    5 |         if (p <= 1)return false;
      |                           ^~~~~
main.c:2:1: note: 'false' 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:5:27: note: each undeclared identifier is reported only once for each function it appears in
    5 |         if (p <= 1)return false;
      |                           ^~~~~
main.c:8:16: error: 'true' undeclared (first use in this function)
    8 |         return true;
      |                ^~~~
main.c:8:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include <iostream>
using namespace std;

int main(){
	int x, i, j, flag;
    cin >> x;
	for(i=x;i<=x+100;i++)
    {
		flag = 0
        for(j=2;j<=i;j++)
        {
			if(i%j==0) flag++;
		}
		if(flag==0) break;   
	}
	cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ';' before 'for'
    9 |                 flag = 0
      |                         ^
      |                         ;
   10 |         for(j=2;j<=i;j++)
      |         ~~~              
a.cc:10:25: error: expected ';' before ')' token
   10 |         for(j=2;j<=i;j++)
      |                         ^
      |                         ;
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
int N;
  
 
bool isPrime(int n)  
{  
    
    if (n <= 1)  return false;  
    if (n <= 3)  return true;  
    
   
    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;  
}  
  
 

  
    return prime; 
} 
  
 
int main() 
{ 
    cin>>N;
  	int x;
 	cin>>x;

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

 	cout<<p<<endl;
 	return 0;

  
   
    return 0; 
} 

Compiler output:
a.cc:25:5: error: expected unqualified-id before 'return'
   25 |     return prime;
      |     ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
a.cc: In function 'int main()':
a.cc:36:16: error: 'is_prime' was not declared in this scope; did you mean 'isPrime'?
   36 |         while(!is_prime(p)) p++;
      |                ^~~~~~~~
      |                isPrime
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int x=scan.nextInt();
    int Ans=0, x1=0;
    boolean flag=false;
    if(x%2==0){
      x1=x+1;
    }else if(x=2){
      Ans=2;
      flag=true;
    }else{
      x1=x;
    }
    while(!flag){
      for(int a=2; a<x1; a++){
        if(x1%a==0){
          flag=true;
        }
      }
      if(!flag){
        Ans=x1;
        flag=true;
      }else{
        flag=false;
      }
      x1+=2;
    }
    System.out.println(Ans);
  }
}

Compiler output:
Main.java:11: error: incompatible types: int cannot be converted to boolean
    }else if(x=2){
              ^
1 error
Language: C++

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

int sieve[100000];

int main()
{
    for (int i = i < 100000; i++) {
        sieve[i] = 1;
    }
    for (int i = 2; i < 100000; i++) {
        for (int j = 2; j < 100000; j++) {
            sieve[i * j] = 0;
        }
    }
    int x;
    cin >> x;
    for (int i = x; i < 100000; i++) {
        if (sieve[i]) {
            cout << i << "\n";
            break;
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: expected ';' before ')' token
    8 |     for (int i = i < 100000; i++) {
      |                                 ^
      |                                 ;
Language: C++

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

bool isPrime(int n)  
{  
    /
    if (n <= 1)  return false;  
    if (n <= 3)  return true;  
    
  
    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: In function 'bool isPrime(int)':
a.cc:7:5: error: expected primary-expression before '/' token
    7 |     /
      |     ^
a.cc:8:5: error: expected primary-expression before 'if'
    8 |     if (n <= 1)  return false;
      |     ^~
Language: C++

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

int main() {

	int N,
    cin >> N;
  
  	if ( N = 2 ){
      cout << N << endl;
    }else if ( N = 3 ){
      cout << N << endl;
    }else{
      while(true){
        bool gouseisuu = false;
        
        for ( int a = 2; a*a <= N; a++){
          if ( N % a == 0 ){
            gouseisuu = true;
          }
        }
        
        if (gouseisuu){
          break;
        }
        
        N ++;
        
      }
      
    }
      
    cout << N << endl;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before '>>' token
    7 |     cin >> N;
      |         ^~
Language: C++

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

int main() {

	int N,
    cin >> N;
  
  	if ( N = 2 ){
      cout << N << endl;
    }else if ( N = 3 ){
      cout << N << endl;
    }else{
      while(true){
        bool gouseisuu = false;
        
        for ( int a = 2; a*a <= N; a++){
          if ( N % a == 0 ){
            gouseisuu = true;
          }
        }
        
        if (gouseisuu){
          break;
        }
        
        N ++;
        
      }
      
    cout << N << endl;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before '>>' token
    7 |     cin >> N;
      |         ^~
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

int main(){
  ll x,i;
  scanf("%lld",&x);
  if(x==2){
    printf("2");
    return 0;
  }
  if(x%2==0)x+=1;
  while(1){
    if(sosuu(x)) break;
    x+=2;
  }
  printf("%lld",x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:2:3: error: unknown type name 'll'
    2 |   ll x,i;
      |   ^~
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%lld",&x);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%lld",&x);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |     printf("2");
      |     ^~~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:8: error: implicit declaration of function 'sosuu' [-Wimplicit-function-declaration]
   10 |     if(sosuu(x)) break;
      |        ^~~~~
main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |   printf("%lld",x);
      |   ^~~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: Java

import java.util.*;
class PrimeNumbers{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int x=scan.nextInt();
     if(2<=x<=100000){
	  	if(x/x==1&&x/1==x){
	  		System.out.println(x);
		}
		else{
		  	for(int i=x;i/i==1&&i/1==i;i++){
			  	System.out.println(i);
			  }
		}
	 }
	 else
	 {
	 	System.out.println("Watch out for overflows");
	 }
  }
}
             

Compiler output:
Main.java:6: error: bad operand types for binary operator '<='
     if(2<=x<=100000){
            ^
  first type:  boolean
  second type: int
1 error
Language: C++

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


int main(void)
{

int n,i;
cin>>n;
printf();
scanf(n);

while(1){
for(i=2;i<n;i++)if(n%i==0)break;
if(i==n){
printf(n);
return 0;
}else{
n++;
}}

return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: too few arguments to function 'int printf(const char*, ...)'
   10 | printf();
      | ~~~~~~^~
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:12: note: declared here
  363 | extern int printf (const char *__restrict __format, ...);
      |            ^~~~~~
a.cc:11:7: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   11 | scanf(n);
      |       ^
      |       |
      |       int
/usr/include/stdio.h:428:42: note:   initializing argument 1 of 'int scanf(const char*, ...)'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:16:8: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   16 | printf(n);
      |        ^
      |        |
      |        int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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


int main(void)
{

int n,i;
cin>>n;
printf("数字=");
scanf("%d",&n);

while(1){
for(i=2;i<n;i++)if(n%i==0)break;
if(i==n){
printf(n);
return 0;
}else{
n++;
}}

return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   16 | printf(n);
      |        ^
      |        |
      |        int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < 1000000; i++) {
    bool prime = false;
    if (N + i == 2) prime = true;

    double sqrtNi = sqrt(N + i);
    bool aa = false;
    for (int j = 3; j <= sqrtNi; i += 2) {
        if (num % i == 0) {
          return aa = true;
          break;
        }
    }
    if (aa == false) {
      prime = true;
      cout << N + i << endl;
      break;
    }
  }
}
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |         if (num % i == 0) {
      |             ^~~
      |             enum
Language: C++

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

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < 1000000; i++) {
    bool prime = false;
    if (N + i == 2) prime = true;

    double sqrtNi = sqrt(N + i);
    bool aa = false;
    for (int j = 3; j <= sqrtNi; i += 2) {
        if (num % i == 0) {
          return aa = true;
          break;
        }
    }
    if (aa == false) {
      prime = true;
      break;
    }
  }
  cout << N + i << endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |         if (num % i == 0) {
      |             ^~~
      |             enum
a.cc:24:15: error: 'i' was not declared in this scope
   24 |   cout << N + i << endl;
      |               ^
a.cc:24:25: error: expected '}' at end of input
   24 |   cout << N + i << endl;
      |                         ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(void)
{
int x;
cin>>x;
int p,m;
for (size_t i = 0; i < ; i++)
{
for( m=2 ; m<=x-1 ; m++ ){
if( x % m == 0 ) break;
}	
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected primary-expression before ';' token
   10 | for (size_t i = 0; i < ; i++)
      |                        ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int x, i, j,yakusuu;
    cin >> x;
	for(i=x;i<=x+100;i++){
		yakusuu=0;
		for(j=1;j<=i;j++)
		{
			if(i%j==0) yakusuu++;
		}
		if(yakusuu==2) break;
    break;    
	}
	cout(i);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: no match for call to '(std::ostream {aka std::basic_ostream<char>}) (int&)'
   16 |         cout(i);
      |         ~~~~^~~
Language: C++

fftftfgff
fh
gfh
gf
hgfdhgfdhhv

h
gh
gfhgfhfgh
f
gh
gf
hg
gf
hgfhgfhgfjhgfh
gfjh
hghg
hfh
fhgf
f
hf
h
gfh
gf
h
gfh
fgh
gfh
hf
gh
gf
h
gf
hgh
hg
hgf
h
hgf

hg
hghg

hg
hgf
h
hg
hg
hg
hgf
hgf
hgf
hgfhg
f
hg
hgfh
ghg
g
fhgh
f
h
gfh
gf
hg
fh
gf
hgf
hg
f
h
gfh
g
h
gf
h
fgh
g
fh
gf
h
gf
hgf
h
fg
h
gf
h
gfh
gf
h
fh
gh
gf
h
ghf
gjhgfjhg
gf


jg
hj

hg
gh
j
hg

jf
j

hg
j
hg
jh
f

hg

g
j
hgj
g

jhg
j
h
j
hj
g
jh

g
jh
jh

Compiler output:
a.cc:1:1: error: 'fftftfgff' does not name a type
    1 | fftftfgff
      | ^~~~~~~~~
Language: Java

import java.util.Scanner;

public class AtCoderTest {
    static boolean is_prime(int n)
    {

        if (n <= 1) return false;
        if (n <= 3) return true;


        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;
    }
    static int nextPrime(int N)
    {
        if (N <= 1 || N == 2)
            return 2;

        int prime = N;
        boolean found = false;

        while (!found)
        {
            prime++;

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

        return prime;
    }

    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        if (is_prime(N)){
            System.out.println(N);
        }
        else{
                System.out.println(nextPrime(N));
        }
    }
}




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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int X;
  cin>>X;
  if(X==2) cout<<2,<endl;
  else{
  int i=0;
  
  while(i>=0){
    bool prime=true;
    int k=X+i;
    int t=sqrt(k);
    int a=1;
    while(a<=t){
      a++;
      if(k%a==0){
        prime=false;
       
        break;
      }
    }
    if(prime==true)break;
    else i++;
  }
  cout<<X+i<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: expected primary-expression before '<' token
    6 |   if(X==2) cout<<2,<endl;
      |                    ^
Language: C++

#include <bits/stdc++.h>
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;
    while (IsPrime(X) == true) {
        X = X + 1;
    }
    cout << X << emdl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: 'emdl' was not declared in this scope
   28 |     cout << X << emdl;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;

void normal(vll &a,ll n){
  
	for(int i = 1; i <=  n; i++){
		int count = 0;
		for(int j = 1; j <= i; j++){
			if(i % j == 0){
				count++;
			}
			if(count > 2){
				break;
			}
		}
		if(count == 2){
         a.pb(i);
		}
	}
}
int main(){
  ll n;
  cin>>n;
  vll a(0);
  normal(a,n);
  ll g=a.size();
  ll cu=0;
  while(){
    for(int i=0;i<=g;i++){
      if(n%a[i]==0) {
        break;
      }
      if(i==g){
        cu=n;
        break;
      }
    }
    if(cu!=0) break;
    n++;
  }
  COUT(cu);
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:56:9: error: expected primary-expression before ')' token
   56 |   while(){
      |         ^
Language: C++

const int N /*値*/;
void eratosthenes(bool prime[N]){
    rep(i,N) prime[i] = 1;
    prime[0] = prime[1] = 0;
    rep(i,N){
        if(prime[i]){
            for(int j = i + i; j < N; j+=i){
                prime[j] = 0;
            }
        }
    }
}

Compiler output:
a.cc:1:11: error: uninitialized 'const N' [-fpermissive]
    1 | const int N /*値*/;
      |           ^
a.cc:2:30: error: size of array 'prime' is not an integral constant-expression
    2 | void eratosthenes(bool prime[N]){
      |                              ^
a.cc: In function 'void eratosthenes(bool*)':
a.cc:3:9: error: 'i' was not declared in this scope
    3 |     rep(i,N) prime[i] = 1;
      |         ^
a.cc:3:5: error: 'rep' was not declared in this scope
    3 |     rep(i,N) prime[i] = 1;
      |     ^~~
Language: C

// CPP program to find the Smallest Special Prime 
// which is greater than or equal to a given number 
#include <bits/stdc++.h> 
using namespace std; 
  
// Function to check whether the number 
// is a special prime or not 
bool checkSpecialPrime(bool* sieve, int num) 
{ 
    // While number is not equal to zero 
    while (num) { 
        // If the number is not prime 
        // return false. 
        if (!sieve[num]) { 
            return false; 
        } 
  
        // Else remove the last digit 
        // by dividing the number by 10. 
        num /= 10; 
    } 
  
    // If the number has become zero 
    // then the number is special prime, 
    // hence return true 
    return true; 
} 
  
// Function to find the Smallest Special Prime 
// which is greater than or equal to a given number 
void findSpecialPrime(int N) 
{ 
    bool sieve[N*10]; 
  
    // Initially all numbers are considered Primes. 
    memset(sieve, true, sizeof(sieve)); 
    sieve[0] = sieve[1] = false; 
    for (long long i = 2; i <= N*10; i++) { 
        if (sieve[i]) { 
  
            for (long long j = i * i; j <= N*10; j += i) { 
                sieve[j] = false; 
            } 
        } 
    } 
  
    // There is always an answer possible 
    while (true) { 
        // Checking if the number is a 
        // special prime or not 
        if (checkSpecialPrime(sieve, N)) { 
            // If yes print the number 
            // and break the loop. 
            cout << N; 
            break; 
        } 
        // Else increment the number. 
        else
            N++; 
    } 
} 
  
// Driver code 
int main() 
{ 
    int N; 
  	cin >> N;
  
    findSpecialPrime(N); 
  
    return 0; 
} 

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

#include <iostream>
#include <cstring>
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;
	int p = 0;

	cin >> X;
	p = X;

	while (!IsPrime(p)) {
		p++;
	}

	cout << p;

}

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

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

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

import java.util.Scanner;
 
public class Main
{
  public static void main(String args[])
  {
    Scanner std = new Scanner(System.in);
    int n = std.nextInt();
    
    end:while(true)
    {
        for(int i = 2; i < n; i++)
    	{
      		if(n % i != 0)
      		{
        		System.out.println(n);
              return end;
      		}
    	}
      n++;
    }
  }
}

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

import java.util.Scanner;

public class Main
{
  public static void main(String args[])
  {
    Scanner std = new Scanner(System.in);
    int n = std.nextInt();
    
    end:while(true)
    {
        for(int i = 2; i < n; i++)
    	{
      		if(n % i != 0)
      		{
        		System.out.println(n);
              return end;
      		}
    	}
      n++;
    }
    

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

#include <stdio.h>

int isPrime(int n)
{
    int i,j=0;
    for(i=1; i<=n; i++)
    {
        if(n%i == 0)
            j++;
    }
    if(j == 2)
        return 1;
    else if(j > 2)
        return 0;
}

int fun(unsigned int n)
{
    int i=n;
    while(1)
    {
        if(isPrime(i))
            break;
        i++;
    }
    return i;
}

int main(int argc, char **argv)
{
  int n;
  scanf("%lld",&n)
    
    printf("%lld\n", fun(n));
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:19: error: expected ';' before 'printf'
   32 |   scanf("%lld",&n)
      |                   ^
      |                   ;
   33 | 
   34 |     printf("%lld\n", fun(n));
      |     ~~~~~~
Language: C

#include<stdio.h>
int so[10000] = { 0 };
int s(int a)
{
	int i, j,count=0;
	so[0] = 2;
	for (i = 2; i < a; i++)
	{
		for (j = 0; so[j] > 0; j++)
		{
			if (i % so[j] == 0)break;
			count++;
		}
		if (count == j + 1)
		{
			so[j] = i;
		}
	}
}

int main(void)
{
	int a,i,j;
	scanf("%d", a);
	s(a);
	
  	for(i=a;;i++)
    {
      for(j=0;so[j]>0;j++)
      {
        if(i%so[j]==0)break;
      }
      if(so[j]==0)
      {
        printf("%d",i);
        return;
      }
    }
}



}

Compiler output:
main.c: In function 'main':
main.c:36:9: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   36 |         return;
      |         ^~~~~~
main.c:21:5: note: declared here
   21 | int main(void)
      |     ^~~~
main.c: At top level:
main.c:43:1: error: expected identifier or '(' before '}' token
   43 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define N 100001
int main()
{
  int prime[N]={1};
  prime[0]=0;
  prime[1]=0;
  for(int i=2;i<N;i++)
  {
    if(prime[i]==1)
    {
      for(int j=2;i*j<N;j++)
        prime[i*j]=0;
    }
  }
  int x;
  cin>>x;
  for(int i=x;;i++)
  {
    if(prime[i]==1)
    {
      cout<<i;
      break;
    }
  }
  


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

#include<bits/stdc++.h>
using namespace std;
#define N 100001;
int main()
{
  int prime[N]={1};
  prime[0]=0;
  prime[1]=0;
  for(int i=2;i<N;i++)
  {
    if(prime[i]==1)
    {
      for(int j=2;i*j<N;j++)
        prime[i*j]=0;
    }
  }
  int x;
  cin>>x;
  for(int i=x;;i++)
  {
    if(prime[i]==1)
    {
      cout<<i;
      break;
    }
  }
  


Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: expected ']' before ';' token
    3 | #define N 100001;
      |                 ^
a.cc:6:13: note: in expansion of macro 'N'
    6 |   int prime[N]={1};
      |             ^
a.cc:6:14: error: expected primary-expression before ']' token
    6 |   int prime[N]={1};
      |              ^
a.cc:7:3: error: 'prime' was not declared in this scope
    7 |   prime[0]=0;
      |   ^~~~~
a.cc:9:18: error: expected primary-expression before ';' token
    9 |   for(int i=2;i<N;i++)
      |                  ^
a.cc:9:18: error: expected ')' before ';' token
    9 |   for(int i=2;i<N;i++)
      |      ~           ^
a.cc:9:19: error: 'i' was not declared in this scope
    9 |   for(int i=2;i<N;i++)
      |                   ^
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define N 100001;
int main()
{
  int prime[n]={1};
  prime[0]=0;
  prime[1]=0;
  for(int i=2;i<n;i++)
  {
    if(prime[i]==1)
    {
      for(int j=2;i*j<n;j++)
        prime[i*j]=0;
    }
  }
  int x;
  cin>>x;
  for(int i=x;;i++)
  {
    if(prime[i]==1)
    {
      cout<<i;
      break;
    }
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   int prime[n]={1};
      |             ^
      |             yn
a.cc:7:3: error: 'prime' was not declared in this scope
    7 |   prime[0]=0;
      |   ^~~~~
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

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

int main() {
	
	int X;
	int ans = 0;
	int flag = 0;
	scanf("%d", &X);

	for (int i = X; i < 100000; i++) {

		if (X == 2 or X == 3 or X == 5 or X == 7) {
			ans = X;
			break;
		}

		if (i % 2 == 0) {
			continue;
		}
		else if (i % 3 == 0) {
			continue;
		}
		else if (i % 5 == 0) {
			continue;
		}
		else if (i % 7 == 0) {
			continue;
		}
		else {
			for (int j = 11; j < i; j++) {
				if (i % j == 0) {
					break;
				}
			}
		}
		ans = i;
		break;
	}

	printf("%d", ans);

	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:13:27: error: expected ')' before 'or'
   13 |                 if (X == 2 or X == 3 or X == 5 or X == 7) {
      |                    ~      ^~~
      |                           )
Language: C++

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

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


int main(){
  ll n;
  cin>>n;
  if(n==2){cout<<n<<endl;return 0;}
  if(n%2==0){++n;}
  while(1){
    if(is_prime(n)){cout<<n<<endl;return 0;}
    n+=2;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'll' was not declared in this scope
   13 |   ll n;
      |   ^~
a.cc:14:8: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 |   cin>>n;
      |        ^
      |        yn
Language: C++

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

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


int main(){
  ll n;
  cin>>n;
  if(n==2){cout<<n<<endl;return 0;}
  if(n%2==0){++n;}
  while(1){
    if(is_primt(n)){cout<<n<<endl;return 0;}
    n+=2;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'll' was not declared in this scope
   13 |   ll n;
      |   ^~
a.cc:14:8: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 |   cin>>n;
      |        ^
      |        yn
a.cc:18:8: error: 'is_primt' was not declared in this scope; did you mean 'is_prime'?
   18 |     if(is_primt(n)){cout<<n<<endl;return 0;}
      |        ^~~~~~~~
      |        is_prime
Language: C++

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

int main(){

long long X;
int k;
long long start = 0;
if(X % 2 == 0){
start = X + 1;
}
for(int i=start;i>X;i=i+2){
    k = 0;
    for(int j=3;j<sqrt(i);j+=2){
        if(i % j == 0){
            k = 1;
            break;
        }
    }
    if(k == 0){
        cout << i;
        exit(0);
    }
}
if

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:1: error: expected '(' before 'return'
   27 | return 0;
      | ^~~~~~
      | (
Language: Java

def is_prime(num):
  i = 5
  while (i * i <= num):
      if num % i == 0 or num % (i+2) ==0:
          return False
      i+=6
  return True if num > 1 and num <=3 else False if num % 2 == 0 or num % 3 == 0 or num <=1 else True

k = int(input())
if is_prime(k):
  print(k)
else:
  while(not is_prime(k)):
    k +=1
  print(k)

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
def is_prime(num):
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
def is_prime(num):
                ^
Main.java:1: error: ';' expected
def is_prime(num):
                 ^
Main.java:9: error: class, interface, enum, or record expected
k = int(input())
    ^
4 errors
Language: Java

def check(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
                break
        else:
            return True
    else:
        return False


a = int(input())

for i in range(a, 100500):
    if check(i):
        print(i)
        break

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
def check(num):
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
def check(num):
             ^
Main.java:1: error: ';' expected
def check(num):
              ^
Main.java:13: error: class, interface, enum, or record expected
a = int(input())
    ^
4 errors
Language: C++

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

int eratos(ll n,vector<bool>s){
    s[0]=false;
    s[1]=false;
    for(int i=2;i<=n;i++){
        for(int j=i+i;j<n;j+=i){
            s[j]=false;
        }
    }
}

int main(){
    ll x;
    cin>>x;
    vector<bool>s[x+100]={true};
    ll termx=0;
    ll ans;
    eratos((x+100),s);
    for(int i=x;i*i<=n;i++){
        if(x%i==0){
            termx=0;
        }else{
            temx = x;
            ans = termx;
            break;
        }
    }
    if(temx==0){
        bool can =true;
        while(can){
            termx++;
            if(s[termx])ans=termx;can=false;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int eratos(long long int, std::vector<bool>)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int main()':
a.cc:18:31: error: conversion from 'bool' to non-scalar type 'std::vector<bool>' requested
   18 |     vector<bool>s[x+100]={true};
      |                               ^
a.cc:21:20: error: could not convert '(std::vector<bool>*)(& s)' from 'std::vector<bool>*' to 'std::vector<bool>'
   21 |     eratos((x+100),s);
      |                    ^
      |                    |
      |                    std::vector<bool>*
a.cc:22:22: error: 'n' was not declared in this scope
   22 |     for(int i=x;i*i<=n;i++){
      |                      ^
a.cc:26:13: error: 'temx' was not declared in this scope; did you mean 'termx'?
   26 |             temx = x;
      |             ^~~~
      |             termx
a.cc:31:8: error: 'temx' was not declared in this scope; did you mean 'termx'?
   31 |     if(temx==0){
      |        ^~~~
      |        termx
a.cc:35:23: error: could not convert 's[termx]' from 'std::vector<bool>' to 'bool'
   35 |             if(s[termx])ans=termx;can=false;
      |                ~~~~~~~^
      |                       |
      |                       std::vector<bool>
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
   
  int X;
  
  cin >> X;
  
  if(i=0;i<n;i++){
  cout << n << endl;
  }
   }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 'i' was not declared in this scope
   10 |   if(i=0;i<n;i++){
      |      ^
a.cc:10:12: error: 'n' was not declared in this scope
   10 |   if(i=0;i<n;i++){
      |            ^
a.cc:10:13: error: expected ')' before ';' token
   10 |   if(i=0;i<n;i++){
      |     ~       ^
      |             )
a.cc:10:14: error: 'i' was not declared in this scope
   10 |   if(i=0;i<n;i++){
      |              ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <map>
#include<string>
#include <cmath>
using namespace std;
typedef long long ll;

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

  int Y = sqrt(X);
  bool odd = true, even = true;

  if(Y == 1) cout << X << endl;
  else{
    while(odd || even){
      odd = false;
      even = false;
      for(int i = 3; i <= Y; i += 2){
        if(X%i==0){
          odd = true;
          break;
        }
      }
      if(X%2==0) even = true;
      ++X;
    }
    --X;
    cout << X << endl;
  }

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

#include <bits/stdc++.h> 
using namespace std; 
  
// set the MAX_SIZE of the array to 10^6 
const int MAX_SIZE = 1e6; 
  
// initialize the prime array 
bool prime[MAX_SIZE + 1]; 
  
void sieve() 
{ 
  
    // set all numbers as prime for time being 
    memset(prime, true, sizeof(prime)); 
  
    for (int p = 2; p * p <= MAX_SIZE; p++) { 
  
        // if prime[p] is not changed, then it is a prime 
        if (prime[p] == true) { 
  
            // update all multiples of p 
            for (int i = p * p; i <= MAX_SIZE; i += p) 
                prime[i] = false; 
        } 
    } 
} 
// Function to find the kth prime greater than n 
int kthPrimeGreaterThanN(int n, int k) 
{ 
  
    int res = -1; 
    // looping through the numbers greater than n 
    for (int i = n + 1; i < MAX_SIZE; i++) { 
  
        // decrement k if i is prime 
        if (prime[i] == true) 
            k--; 
  
        // store the kth prime greater than n 
        if (k == 0) { 
            res = i; 
            break; 
        } 
    } 
  
    return res; 
} 
  
// Driver code 
int main() 
{ 
  int n,k,f=0;
  cin>>n;
    if(n%2!=0)
    {  for(i=3;i<=n/2;++i)
          { if(n%i==0)
               {f=1;
                 break;
                }
           }
    }
  if(f==0)
  {
    cout<<n<<endl;
  }
  
}
  else
  {
  
    sieve(); 
    
  
    // Print the kth prime number greater than n 
    cout << kthPrimeGreaterThanN(n, 1); 
  }
    return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:55:12: error: 'i' was not declared in this scope
   55 |     {  for(i=3;i<=n/2;++i)
      |            ^
a.cc: At global scope:
a.cc:68:3: error: expected unqualified-id before 'else'
   68 |   else
      |   ^~~~
a.cc:77:5: error: expected unqualified-id before 'return'
   77 |     return 0;
      |     ^~~~~~
a.cc:78:1: error: expected declaration before '}' token
   78 | }
      | ^