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

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

int main(void){
  int i,n,j,x,y,p[100000];
  char str[10];
  
  fgets(str,sizeof(str),stdin);
  x=atoi(str);
  
  n=-1;
  while(n<0){
    y=(int)sqrt((double)x)
    for(i=0;i<=y;i++){
      if(x%i==0){
        break;
      }
      if(i==y){
        n=i;
      }
    }
    x++;
  }
  
  printf("%d\n",x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:27: error: expected ';' before 'for'
   15 |     y=(int)sqrt((double)x)
      |                           ^
      |                           ;
   16 |     for(i=0;i<=y;i++){
      |     ~~~
Language: C

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

int main(void){
  int i,n,j,x,p[100000];
  double y;
  
  fgets(str,sizeof(str),stdin);
  x=atoi(str);
  
  n=-1;
  while(n<0){
    for(i=0;i<=(int)sqrt(x);i++){
      if(x%i==0){
        break;
      }
      if(i==(int)sqrt(x)){
        n=i;
      }
    }
    x++;
  }
  
  printf("%d\n",x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'str' undeclared (first use in this function)
   10 |   fgets(str,sizeof(str),stdin);
      |         ^~~
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(void){
  int i,n,j,x,p[100000];
  double y;
  
  fgets(str,sizeof(str),stdin);
  x=atoi(str);
  
  n=-1;
  while(n<0){
    for(i=0;i<=(int)sqrt(x);i++){
      if(x%p==0){
        break;
      }
      if(i==(int)sqrt(x)){
        n=i;
      }
    }
    x++;
  }
  
  printf("%d\n",x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'str' undeclared (first use in this function)
   10 |   fgets(str,sizeof(str),stdin);
      |         ^~~
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:11: error: invalid operands to binary % (have 'int' and 'int *')
   16 |       if(x%p==0){
      |           ^
      |           |
      |           int *
Language: C

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

int main(void){
  int i,n,j,x,p[100000];
  double y;
  
  fgets(str,sizeof(str),stdin);
  x=atoi(str);
  
  n=-1;
  while(n<0){
    for(i=0;i<=(int)sqrt(x);i++){
      if(x%p==0){
        break;
      }
      if(i==(int)sqrt(x)){
        n=i;
      }
    }
    x++;
  }
  
  printf("%d\n",x);
  
    }

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'str' undeclared (first use in this function)
   10 |   fgets(str,sizeof(str),stdin);
      |         ^~~
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:11: error: invalid operands to binary % (have 'int' and 'int *')
   16 |       if(x%p==0){
      |           ^
      |           |
      |           int *
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb(x) push_back(x)
#define rep(a,b) for(ll int a=0;a<b;a++)
#define Tcase int t;cin>>t;while(t--)
isPrime(long int x){
int i=0;
  for( i=2;i<=sqrt(x);i++){
  if(x%i==0)
    break;
  }
  if(i<=sqrt(x))
    return 0;
  else
    return 1;
}
int main(){
  long int x;
  cin>>x;
  while(!isPrime(x)){
  x++;
  }
  cout<<x<<endl;
return 0;
}


Compiler output:
a.cc:7:1: error: ISO C++ forbids declaration of 'isPrime' with no type [-fpermissive]
    7 | isPrime(long int x){
      | ^~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
  int a, f, i;
  cin >> a;
  
  if(a%2==0){
	f = a + 1;
  }else{
    f = a;
  }
  
  while(true){
    for(i=0; i<f; i++){
    if(a % i == 0){
      continue;
    }
    }
    if(i==f){
      cout << f << endl;
      retrun 0;
    }else{
      f+=2;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: 'retrun' was not declared in this scope
   23 |       retrun 0;
      |       ^~~~~~
a.cc:27:4: error: expected '}' at end of input
   27 |   }
      |    ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

bool is_prime(int u)
{
    if(u == 0 || u == 1) return false;
    if(u == 2) return true;
    if(u%2 == 0) return false;
    for(int i=3; i <= sqrt(u) ;i+=2)
    if(u%i==0) return false;
    return true;
}

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

  for(; ; a++)
  {
    if(is_prime(a))
    {
      cout<<a<<endl;
      return 0;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:19:23: error: 'sqrt' was not declared in this scope
   19 |     for(int i=3; i <= sqrt(u) ;i+=2)
      |                       ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:5:13: error: 'num' was not declared in this scope; did you mean 'enum'?
    5 |     else if(num=2) return true;
      |             ^~~
      |             enum
a.cc:9:12: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |         if(num%i==0)return false;
      |            ^~~
      |            enum
Language: C++

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

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:5:13: error: 'num' was not declared in this scope; did you mean 'enum'?
    5 |     else if(num=2) return true;
      |             ^~~
      |             enum
a.cc:9:12: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |         if(num%i==0)return false;
      |            ^~~
      |            enum
a.cc: In function 'int main()':
a.cc:16:17: error: 'x' was not declared in this scope
   16 |     while(prime(x)==false)x++;
      |                 ^
a.cc:17:13: error: 'x' was not declared in this scope
   17 |     cout << x << endl;
      |             ^
Language: C++

import java.math.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    while (true) {
      if (BigInteger.valueOf(x).isProbablePrime(100)) {
        System.out.println(x);
        return;
      }
      x++;
    }
  }
}

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

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

vector<bool> sieve(1000000, true);

void initialize() {
  for(int i=2; i<1000000; i++) {
    if(sieve[i]) {
      for(int j=2*i; j<1000000; j++) {
        sieve[j] = false;
      }
    }
}

int main() {
  initialize();
  int n;
  cin >> n;
  for(int i=n; ; i++) {
    if(sieve[i]) {
      cout << i << endl;
      break;
    }
  }
  
  return 0;
}

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

#include <iostream>
using namespace std;

vector<bool> sieve(1000000, true);

void initialize() {
	for(int i=2; i<1000000; i++) {
      if(sieve[i]) {
        for(int j=i<<1; j<1000000; j+=i) {
          sieve[j] = false;
        }
      }
    }
}

int main() {
  int n;
  cin >> n;
  for(int i=n; ; i++) {
    if(sieve[i]) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<bool> sieve(1000000, true);
      | ^~~~~~
a.cc: In function 'void initialize()':
a.cc:8:10: error: 'sieve' was not declared in this scope
    8 |       if(sieve[i]) {
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:20:8: error: 'sieve' was not declared in this scope
   20 |     if(sieve[i]) {
      |        ^~~~~
Language: C++

#include <iostream>
using namespace std;

vector<bool> sieve(1000000, true);

void initialize() {
	for(int i=2; i<1000000; i++) {
      if(sieve[i]) {
        for(int j=i<<1; j<1000000; j++) {
          sieve[j] = false;
        }
      }
    }
}

int main() {
  int n;
  cin >> n;
  for(int i=n; ; i++) {
    if(sieve[i]) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<bool> sieve(1000000, true);
      | ^~~~~~
a.cc: In function 'void initialize()':
a.cc:8:10: error: 'sieve' was not declared in this scope
    8 |       if(sieve[i]) {
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:20:8: error: 'sieve' was not declared in this scope
   20 |     if(sieve[i]) {
      |        ^~~~~
Language: C++

    #include <iostream>
    using namespace std;
     
    vector<bool> sieve(1000000, true);
     
    void initialize() {
      sieve[2] = true;
      for(int i=2; i<1000000; i++) {
        if(sieve[i]) {
          for(int j=2*i; j<1000000; j+=i)
            sieve[i] = false;
        }
    }
     
    int main() {
      int n;
      cin >> n;
      initialize();
      for(int i=n; ; i++) {
        if(sieve[i]) {
          cout << i << endl;
          break;
        }
      }
        return 0;
    }

Compiler output:
a.cc:4:5: error: 'vector' does not name a type
    4 |     vector<bool> sieve(1000000, true);
      |     ^~~~~~
a.cc: In function 'void initialize()':
a.cc:7:7: error: 'sieve' was not declared in this scope
    7 |       sieve[2] = true;
      |       ^~~~~
a.cc:15:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 |     int main() {
      |             ^~
a.cc:15:13: note: remove parentheses to default-initialize a variable
   15 |     int main() {
      |             ^~
      |             --
a.cc:15:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:16: error: a function-definition is not allowed here before '{' token
   15 |     int main() {
      |                ^
a.cc:26:6: error: expected '}' at end of input
   26 |     }
      |      ^
a.cc:6:23: note: to match this '{'
    6 |     void initialize() {
      |                       ^
Language: C++

#include <iostream>
using namespace std;

vector<bool> sieve(1000000, true);

void initialize() {
  sieve[2] = true;
  for(int i=2; i<1000000; i++) {
    if(sieve[i]) {
      for(int j=2*i; j<1000000; j+=i)
        sieve[i] = false;
    }
}

int main() {
  int n;
  cin >> n;
  initialize();
  for(int i=n; ; i++) {
    if(sieve[i]) {
      cout << i << endl;
      break;
    }
    return 0;
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<bool> sieve(1000000, true);
      | ^~~~~~
a.cc: In function 'void initialize()':
a.cc:7:3: error: 'sieve' was not declared in this scope
    7 |   sieve[2] = true;
      |   ^~~~~
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:12: error: a function-definition is not allowed here before '{' token
   15 | int main() {
      |            ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:6:19: note: to match this '{'
    6 | void initialize() {
      |                   ^
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected ')' before ';' token
   11 |     for(int y = x-1; y>0; y--;){
      |        ~                     ^
      |                              )
a.cc:11:31: error: expected primary-expression before ')' token
   11 |     for(int y = x-1; y>0; y--;){
      |                               ^
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'y' was not declared in this scope
   11 |     for(y = x-1; y>0; y--;){
      |         ^
a.cc:11:26: error: expected ')' before ';' token
   11 |     for(y = x-1; y>0; y--;){
      |        ~                 ^
      |                          )
a.cc:11:27: error: expected primary-expression before ')' token
   11 |     for(y = x-1; y>0; y--;){
      |                           ^
Language: Java

import java.util.Scanner;
class Main{
public static void main(String args[]){

Scanner scanner= new Scanner(System.in);

long X=scanner.nextLong();

long i=0;
long l=X+i;
while(l%2!=0){
i++;
}
System.out.println(l);
}


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

#include <iostream>
using namespace std;
int GetNextPrime(int x);
int main()
{
  int x, MAX = 100000;
  cin >> x;
  cout << GetNextPrime(x, MAX) << endl;
  return 0;
}

int GetNextPrime(int x, int MAX)
{
  bool seive[x+50] = {true};
  for(int i = 0; i < x+50; i++)
    seive[i] = true;
  seive[0] = seive[1] = false;
  
  for(int i = 2; i <= MAX/2; i++)
  {
    if(seive[i])
    {
      for(int j = 2; i*j <= MAX; j++)
      {
        if(seive[i*j])
          seive[i*j] = false;
      }
    }
  }
  for(int i = x; i < (x+50)/2; i++)
  {
    if(seive[i])
      return i;
  }
  return -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: too many arguments to function 'int GetNextPrime(int)'
    8 |   cout << GetNextPrime(x, MAX) << endl;
      |           ~~~~~~~~~~~~^~~~~~~~
a.cc:3:5: note: declared here
    3 | int GetNextPrime(int x);
      |     ^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int GetNextPrime(int x, int MAX);
int main()
{
  int x, MAX = 100000;
  cin >> x;
  cout << GetNextPrime(x) << endl;
  return 0;
}

int GetNextPrime(int x, int MAX)
{
  bool seive[x+50] = {true};
  for(int i = 0; i < x+50; i++)
    seive[i] = true;
  seive[0] = seive[1] = false;
  
  for(int i = 2; i <= MAX/2; i++)
  {
    if(seive[i])
    {
      for(int j = 2; i*j <= MAX; j++)
      {
        if(seive[i*j])
          seive[i*j] = false;
      }
    }
  }
  for(int i = x; i < (x+50)/2; i++)
  {
    if(seive[i])
      return i;
  }
  return -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: too few arguments to function 'int GetNextPrime(int, int)'
    8 |   cout << GetNextPrime(x) << endl;
      |           ~~~~~~~~~~~~^~~
a.cc:3:5: note: declared here
    3 | int GetNextPrime(int x, int MAX);
      |     ^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int GetNextPrime(int x);
int main()
{
  int x, MAX = 100000;
  cin >> x;
  cout << GetNextPrime(x) << endl;
  return 0;
}

int GetNextPrime(int x, int MAX)
{
  bool seive[x+50] = {true};
  for(int i = 0; i < x+50; i++)
    seive[i] = true;
  seive[0] = seive[1] = false;
  
  for(int i = 2; i <= MAX/2; i++)
  {
    if(seive[i])
    {
      for(int j = 2; i*j <= MAX; j++)
      {
        if(seive[i*j])
          seive[i*j] = false;
      }
    }
  }
  for(int i = x; i < (x+50)/2; i++)
  {
    if(seive[i])
      return i;
  }
  return -1;
}

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

#include <iostream>
using namespace std;

int main()
{
  int x, MAX = 100000;
  cin >> x;
  cout << GetNextPrime(x) << endl;
  return 0;
}

int GetNextPrime(int x)
{
  bool seive[x+50] = {true};
  for(int i = 0; i < x+50; i++)
    seive[i] = true;
  seive[0] = seive[1] = false;
  
  for(int i = 2; i < x+50; i++)
  {
    if(seive[i])
    {
      for(int j = 2; i*j <= (x+50); j++)
      {
        if(seive[i*j])
          seive[i*j] = false;
      }
    }
  }
  for(int i = x; i < (x+50)/2; i++)
  {
    if(seive[i])
      return i;
  }
  return -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'GetNextPrime' was not declared in this scope
    8 |   cout << GetNextPrime(x) << endl;
      |           ^~~~~~~~~~~~
Language: C++

#include <iostream?
using namespace std;

int main()
{
  int x, MAX = 100000;
  cin >> x;
  cout << GetNextPrime(x) << endl;
  return 0;
}

int GetNextPrime(int x)
{
  bool seive[x+50] = {true};
  seive[0] = seive[1] = false;
  
  for(int i = 2; i < x+50; i++)
  {
    if(seive[i])
    {
      for(int j = 2; i*j <= (x+50); j++)
      {
        if(seive[i*j])
          seive[i*j] = false;
      }
    }
  }
  for(int i = x; i < (x+50)/2; i++)
  {
    if(seive[i])
      return i;
  }
  return -1;
}

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

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

int main() {
    long a;
    int c;
    cin >> a;
    for (int i = a+1; 100000; i++){
        c = sosuu(i);
        if (c == 0) continue;
        cout << i << endl;
    }
}

int sosuu(x) {
    long x;
    for (long i = 2; i < x; i++){
    	if (x%i == 0) return 0;
    }
    return 1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'sosuu' was not declared in this scope
   10 |         c = sosuu(i);
      |             ^~~~~
a.cc: At global scope:
a.cc:16:11: error: 'x' was not declared in this scope
   16 | int sosuu(x) {
      |           ^
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<queue>

using namespace std;
#define MAX 150000
int sieve[MAX+1]={0};//i番目が整数iに対応(1~100000)
//エラトステネスの篩を実装する
void sieve(){
  //0のところは素数
  for(int i=2;i<=1000;i++){
    if(sieve[i]==0){
      for(int j=1;j<=floor(MAX/i);j++){
        if(j!=1) sieve[j*i]=1;
      }
    }
  }
}


int main(){
  int k;cin >> k;
  for(int i=k;i<=100010;i++){
    if(sieve[i]==0){cout << i << endl;break;}
  }
}


Compiler output:
a.cc:10:12: error: 'void sieve()' redeclared as different kind of entity
   10 | void sieve(){
      |            ^
a.cc:8:5: note: previous declaration 'int sieve [150001]'
    8 | int sieve[MAX+1]={0};//i番目が整数iに対応(1~100000)
      |     ^~~~~
Language: C

#include <iostream>
using namespace std;

int isPrime(int n){
  for (int i=2; i*i<=n; i++){
    if (n%i==0) return 0;
  }
  return 1;
}
int main(void){
  int n;

  cin >> n;
  while(isPrime(n)==0) n++;
  cout << n << endl;
  return 0;
}


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

// C++ implementation of the approach 
#include <bits/stdc++.h> 
using namespace std; 
  
// Function that returns true if n  
// is prime else returns false  
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;  
}  
  
// Function to return the smallest 
// prime number greater than N 
int nextPrime(int N) 
{ 
  
    // Base case 
    if (N <= 1) 
        return 2; 
  
    int prime = N; 
    bool found = false; 
  
    // Loop continuously until isPrime returns 
    // true for a number greater than n 
    while (!found) { 
        prime++; 
  
        if (isPrime(prime)) 
            found = true; 
    } 
  
    return prime; 
} 
  
// Driver code 
int main() 
{ 
    ll n;
  cin>>n;
  
    cout << nextPrime(n); 
  
    return 0; 
} 

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

#include<bits/stdc++.h>
using namespace std;
int main () {
  vector<int>a(100300, 0);
  a[0] = a[1] = -1;
  for (int i = 2; i < 100300; i ++) {
    if (a[i] == 0) {
      a[i] = 1;
      for (int j = 2; j < 100300 / i; j ++) {
        a[i * j] = -1;
      }
    }
  }
  vector<int>b(100300);
  int N = 0;
  for (int i = 2; i < 100300; i ++) {
    if (a[i] == 1) {
      b[N] = i;
      N ++;
    }
  }
  int X;
  cin >> X;
  int min = 0;
  int max = N;
  while(min != max) {
    int min = (min + max) / 2;
    if (b[min] > X) max = mid;
    else min = mid + 1;
  }
  cout << min << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:28:27: error: 'mid' was not declared in this scope; did you mean 'min'?
   28 |     if (b[min] > X) max = mid;
      |                           ^~~
      |                           min
a.cc:29:16: error: 'mid' was not declared in this scope; did you mean 'min'?
   29 |     else min = mid + 1;
      |                ^~~
      |                min
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main () {
  vector<int>a(100300, 0);
  a[0] = a[1] = -1;
  for (int i = 2; i < 100300; i ++) {
    if (a[i] == 0) {
      a[i] = 1;
      for (int j = 2; j < 100300 / i; j ++) {
        a[i * j] = -1;
      }
    }
  }
  vector<int>b();
  for (int i = 2; i < 100300; i ++) {
    if (a[i] == 1) b.push_back(i);
  }
  int N = b.size();
  int X;
  cin >> X;
  int min = 0;
  int max = N;
  while(min != max) {
    int min = (min + max) / 2;
    if (b[min] > X) max = mid;
    else min = mid + 1;
  }
  cout << min << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   14 |   vector<int>b();
      |               ^~
a.cc:14:15: note: remove parentheses to default-initialize a variable
   14 |   vector<int>b();
      |               ^~
      |               --
a.cc:16:22: error: request for member 'push_back' in 'b', which is of non-class type 'std::vector<int>()'
   16 |     if (a[i] == 1) b.push_back(i);
      |                      ^~~~~~~~~
a.cc:18:13: error: request for member 'size' in 'b', which is of non-class type 'std::vector<int>()'
   18 |   int N = b.size();
      |             ^~~~
a.cc:25:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |     if (b[min] > X) max = mid;
      |              ^
a.cc:25:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |     if (b[min] > X) max = mid;
      |         ~~~~~~~^~~
a.cc:25:27: error: 'mid' was not declared in this scope; did you mean 'min'?
   25 |     if (b[min] > X) max = mid;
      |                           ^~~
      |                           min
a.cc:26:16: error: 'mid' was not declared in this scope; did you mean 'min'?
   26 |     else min = mid + 1;
      |                ^~~
      |                min
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'flag' was not declared in this scope
    7 |     flag=0;
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <list>
#include <sstream>
#include <algorithm>
#include <stack>
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <cmath>
#include <string>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<int, int> vii;
typedef map<string, int> msi;
typedef set<int> si;

#define trvi(c, it) for (vi::iterator it = (c).begin(); it != (c).end(); ++it)
#define trvii(c, it) for (vii::iterator it = (c).begin(); it != (c).end(); ++it)
#define trmsi(c, it) for (msi::iterator it = (c).begin(); it != (c).end(); ++it)
#define trsi(c, it) for (si::iterator it = (c).begin(); it != (c).end(); ++it)


#define debug(x) cout << '>' << #x << ':' << x << endl;
#define rep(i,n) for(int i=0;i<(n);++i)
#define fori(i,a,b) for(int i=(a);i<=(b);++i)
#define ford(i,a,b) for(int i=(a);i>=(b);--i)


int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

    int x;
    cin>>x;

    int arr[1000000];
    rep(i, n)
    {
        arr[i] = -1;
    }

    fori(i, 2, 1000000)
    {
        if(arr[i] == -1)
        {
            for(int j = 2*i; j < 1000000; j+=i)
            {
                arr[j] = 1;
            }
        }
    }
    fori(i, x, 1000000)
    {
        if(arr[i] == -1)
        {
            cout<<i;
            break;
        }
    }

 return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:48:12: error: 'n' was not declared in this scope
   48 |     rep(i, n)
      |            ^
a.cc:32:33: note: in definition of macro 'rep'
   32 | #define rep(i,n) for(int i=0;i<(n);++i)
      |                                 ^
Language: C++

#include<iostream>
using namespace std;
bool a[100005];
void is_prime() {
	a[1] = true;
	for (int i = 2; i <= sqrt(100000); i++)
		if (!a[i])
			for (int j = i * i; j <= 100005; j += i)
				a[j] = true;
}
int main() {
	int n;
	cin >> n;
	is_prime();
	for (int i = n; i < 100005; i++)
		if (!a[i])
			return cout << i,0;
	return 0;
}


Compiler output:
a.cc: In function 'void is_prime()':
a.cc:6:30: error: 'sqrt' was not declared in this scope
    6 |         for (int i = 2; i <= sqrt(100000); i++)
      |                              ^~~~
Language: C++

/*
         Md.Fagun Molla
         18ICTCSE006
         BSMRSTU(SHIICT)
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define End return 0

int prime (int n)
{
    ll i,p=0;
    while(1){
        for(i=2; i<=sqrt(n); i++){
            if(n%i==0){
                p=1;
                break;
            }a
        }
        if(p==1){
            p=0;
            n++;
        }
        else{
            return n;
        }

    }
}

int main () {
    ll a;
    cin>>a;
    cout<<prime(a+1)<<endl;
    End;
}
/* pray for me
All is well
*/



Compiler output:
a.cc: In function 'int prime(int)':
a.cc:19:14: error: 'a' was not declared in this scope
   19 |             }a
      |              ^
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <initializer_list>
#include <regex>
#include <cstdlib>
#include <ctime>
#include <random>
#include <set>
#include <cmath>
#include <iterator>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <forward_list>
#include <map>
#include <xiosbase>
#include <complex>
#include <exception>
#include <algorithm>
#include <numeric>
#include <numeric>
//#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
#define forup(i,a,b) for (auto i = a; i <= b; i++)
#define fordn(i, a, b) for(auto i = a; i < b; ++i)
#define print cout <<
#define input std::cin >>
#define readln(n) getline(std::cin, n);
#define forvec(i, v1) for(auto x: v1)
#define temp template<typename T>

double EPS = 1e-9;
int INF = 1000000005;
long long int modulu = 10e9 + 7;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);

using namespace std;

typedef long long int ll;
typedef long long unsigned llu;
typedef std::vector<std::string> vs;
typedef std::vector<char> vc;
typedef long double ld;
typedef std::vector<ll> vll;
typedef std::deque <ll> dqi;
typedef std::set<ll> seti;
typedef std::string str;

temp
void printans(T a) {
	for (auto x : a) std::cout << x << " ";
}

bool primetest(int x) {
	bool isprime = true;

	for (int i = 2; i <= sqrt(x); ++i) {

		if (x % i == 0) isprime = false;
	}

	return isprime;
}

int main() {

	ll num = 0;
	input num;

	for (num; ; num++) { if (primetest(num)) break; }

	print num;

	return 0;
}

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

#include <vector>
#include <list>
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

int solve(void);

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

int solve(void)
{
	const ll vec_size = 1000000;
	ll X;
	cin >> X;

	vector<bool> is_primes(vec_size, true);
	for (ll i = 0; i < sqrt(is_primes.size()) + 1; i++)
	{
		if (!is_primes[i]) {
			continue;
		}
		if (i == 0 || i == 1) {
			is_primes[i] = false;
			continue;
		}
		for (ll j = i + 1; i * j < is_primes.size(); j++)
		{
			is_primes[i*j] = false;
		}
	}

	for (ll i = X + 1; i < is_primes.size(); i++)
	{
		if (is_primes[i]) {
			cout << i << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:30:28: error: 'sqrt' was not declared in this scope
   30 |         for (ll i = 0; i < sqrt(is_primes.size()) + 1; i++)
      |                            ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int X,i,flg;
    cin >> X;
    flg = 0;
    while(1){
	for(i = 3 ;i <= sqrt(X); i+=2){
      	if(X%j==0){
            flg = 1;
	    X++;
      	  break;
      	}
      }
      if(flg == 0){	  
        cout << X << endl;
        break;
      }
    }
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    7 |     tmp = X;
      |     ^~~
      |     tm
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int X,i,flg; 
    cin >> X;
    flg = 0;
    tmp = X;
    while(1){
      for(j = 2 ;j < X; j++){
      	if(X%j==0){
            flg = 1;
	    X++;
      	  break;
      	}
      }
      if(flg == 0){	  
        cout << X << endl;
        break;
      }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    7 |     tmp = X;
      |     ^~~
      |     tm
a.cc:9:11: error: 'j' was not declared in this scope
    9 |       for(j = 2 ;j < X; j++){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool isPrime(int n)
  {
   for( int i=2;i<=sqrt(n);++i)
   {
     if(n%i==0)
       return false;
   }
  return true;
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: too few arguments to function 'bool isPrime(int)'
   17 |   while(!isPrime()) p++;
      |          ~~~~~~~^~
a.cc:3:6: note: declared here
    3 | bool isPrime(int n)
      |      ^~~~~~~
Language: C++

// C++ implementation of the approach 
#include <bits/stdc++.h> 
using namespace std; 
 
// Function that returns true if n 
// is prime else returns false 
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; 
} 
 
// Function to return the smallest 
// prime number greater than N 
int nextPrime(int N) 
{ 
 
	// Base case 
	if (N <= 1) 
		return 2; 
 
	int prime = N; 
	bool found = false; 
 
	// Loop continuously until isPrime returns 
	// true for a number greater than n 
	while (!found) { 
		prime++; 
 
		if (isPrime(prime)) 
			found = true; 
	} 
 
	return prime; 
} 
 
// Driver code 
int main() 
{ 
	int n; cin >> n;
	if(n == 2) cout << '2'; return 0;}
	else
		cout << nextPrime(n); 
 
	return 0; 
} 

Compiler output:
a.cc:53:9: error: expected unqualified-id before 'else'
   53 |         else
      |         ^~~~
a.cc:56:9: error: expected unqualified-id before 'return'
   56 |         return 0;
      |         ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

// C++ implementation of the approach 
#include <bits/stdc++.h> 
using namespace std; 
 
// Function that returns true if n 
// is prime else returns false 
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; 
} 
 
// Function to return the smallest 
// prime number greater than N 
int nextPrime(int N) 
{ 
 
	// Base case 
	if (N <= 1) 
		return 2; 
 
	int prime = N; 
	bool found = false; 
 
	// Loop continuously until isPrime returns 
	// true for a number greater than n 
	while (!found) { 
		prime++; 
 
		if (isPrime(prime)) 
			found = true; 
	} 
 
	return prime; 
} 
 
// Driver code 
int main() 
{ 
	int n; cin >> n
	if(n == 2) cout << '2'; return 0;}
	else
		cout << nextPrime(n); 
 
	return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:51:24: error: expected ';' before 'if'
   51 |         int n; cin >> n
      |                        ^
      |                        ;
   52 |         if(n == 2) cout << '2'; return 0;}
      |         ~~              
a.cc: At global scope:
a.cc:53:9: error: expected unqualified-id before 'else'
   53 |         else
      |         ^~~~
a.cc:56:9: error: expected unqualified-id before 'return'
   56 |         return 0;
      |         ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

// C++ implementation of the approach 
#include <bits/stdc++.h> 
using namespace std; 

// Function that returns true if n 
// is prime else returns false 
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; 
} 

// Function to return the smallest 
// prime number greater than N 
int nextPrime(int N) 
{ 

	// Base case 
	if (N <= 1) 
		return 2; 

	int prime = N; 
	bool found = false; 

	// Loop continuously until isPrime returns 
	// true for a number greater than n 
	while (!found) { 
		prime++; 

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

	return prime; 
} 

// Driver code 
int main() 
{ 
	int n; cin >> n
	if(n == 2) cout << '2'; break}
	else
		cout << nextPrime(n); 

	return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:51:24: error: expected ';' before 'if'
   51 |         int n; cin >> n
      |                        ^
      |                        ;
   52 |         if(n == 2) cout << '2'; break}
      |         ~~              
a.cc:52:33: error: break statement not within loop or switch
   52 |         if(n == 2) cout << '2'; break}
      |                                 ^~~~~
a.cc:52:38: error: expected ';' before '}' token
   52 |         if(n == 2) cout << '2'; break}
      |                                      ^
      |                                      ;
a.cc: At global scope:
a.cc:53:9: error: expected unqualified-id before 'else'
   53 |         else
      |         ^~~~
a.cc:56:9: error: expected unqualified-id before 'return'
   56 |         return 0;
      |         ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
vector<bool> prime;
void prime(int num){
    prime.resize(num,true);
    prime[0]=false;
    for(int i=0;i*i<num;i++){
        if(prime[i]){
            for(int j=2;(i+1)*j<=num;j++){
                prime[(i+1)*j-1]=false;
            }
        }
    }
}
int main(){
int n;
cin>>n;
make(1000000);
for(int i=n-1;i<1e6;i++)if(prime[i]){cout<<i+1<<endl;return 0;}
}

Compiler output:
a.cc:19:19: error: 'void prime(int)' redeclared as different kind of entity
   19 | void prime(int num){
      |                   ^
a.cc:18:14: note: previous declaration 'std::vector<bool> prime'
   18 | vector<bool> prime;
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:33:1: error: 'make' was not declared in this scope
   33 | make(1000000);
      | ^~~~
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
vector<bool> prime;
void prime(int num){
    prime.resize(num,true);
    prime[0]=false;
    for(int i=0;i*i<num;i++){
        if(prime[i]){
            for(int j=2;(i+1)*j<=num;j++){
                prime[(i+1)*j-1]=false;
            }
        }
    }
}
int main(){
int n;
cin>>n;
prime(1e6);
for(int i=n-1;i<1e6;i++)if(prime[i]){cout<<i+1<<endl;return 0;}
}

Compiler output:
a.cc:19:19: error: 'void prime(int)' redeclared as different kind of entity
   19 | void prime(int num){
      |                   ^
a.cc:18:14: note: previous declaration 'std::vector<bool> prime'
   18 | vector<bool> prime;
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:33:6: error: no match for call to '(std::vector<bool>) (double)'
   33 | prime(1e6);
      | ~~~~~^~~~~
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
vector<bool> prime;
void prime(int num){
    prime.resize(num,true);
    prime[0]=false;
    for(int i=0;i<sqt_num;i++){
        if(prime[i]){
            for(int j=2;(i+1)*j<=num;j++){
                prime[(i+1)*j-1]=false;
            }
        }
    }
}
int main(){
int n;
cin>>n;
prime(1e6);
for(int i=n-1;i<1e6;i++)if(prime[i]){cout<<i+1<<endl;return 0;}
}

Compiler output:
a.cc:19:19: error: 'void prime(int)' redeclared as different kind of entity
   19 | void prime(int num){
      |                   ^
a.cc:18:14: note: previous declaration 'std::vector<bool> prime'
   18 | vector<bool> prime;
      |              ^~~~~
a.cc: In function 'void prime(int)':
a.cc:22:19: error: 'sqt_num' was not declared in this scope
   22 |     for(int i=0;i<sqt_num;i++){
      |                   ^~~~~~~
a.cc: In function 'int main()':
a.cc:33:6: error: no match for call to '(std::vector<bool>) (double)'
   33 | prime(1e6);
      | ~~~~~^~~~~
Language: C++


#include<iostream> using namespace std;

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

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

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

	cout<<p<<endl;
}

Compiler output:
a.cc:2:20: warning: extra tokens at end of #include directive
    2 | #include<iostream> using namespace std;
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   14 |         cin>>x;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |         cout<<p<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |         cout<<p<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int a;
  	cin>>a;
  	bool flag=true;
  	for(int i=a;;i++){
    	for(int j=2;j*j<=a;j++){
        	if(i%j==0) flag=flase;
        }
      if(flag){
      	cout<<i<<endl;
        break;
      }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: 'flase' was not declared in this scope
    9 |                 if(i%j==0) flag=flase;
      |                                 ^~~~~
Language: C++

N = int(input())

if N%2==0 and not N==2:
    N=N+1

while True:
    for i in range(2, N//2):
        if N%i==0:
            N += 2
            continue
    
    break
print(N)


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

#include <iostream>
using namespace std;

int main(){
  int a;
  cin >> a;
  if (a%2 == 0)
    a++
  for (i=3; i*i <= a; i++){
    if(a%i==0){
      a+=2;
      i=3
    }
  }
  printf("%d",a);


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected ';' before 'for'
    8 |     a++
      |        ^
      |        ;
    9 |   for (i=3; i*i <= a; i++){
      |   ~~~   
a.cc:9:13: error: 'i' was not declared in this scope
    9 |   for (i=3; i*i <= a; i++){
      |             ^
a.cc:15:18: error: expected '}' at end of input
   15 |   printf("%d",a);
      |                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a;
  cin >> a;
  if a%2 == 0
    a++
  for (i=3; i*i <= a; i++){
    if(a%i==0){
      a+=2;
      i=3
    }
  }
  printf("%d",a);

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected '(' before 'a'
    7 |   if a%2 == 0
      |      ^
      |      (
a.cc:9:13: error: 'i' was not declared in this scope
    9 |   for (i=3; i*i <= a; i++){
      |             ^
a.cc:15:18: error: expected '}' at end of input
   15 |   printf("%d",a);
      |                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <stdio.h>
int main()
{
  int i, a, num;
  int c = 0;

  scanf("%d", &num);

  for (a = num; a < 100000; a++)
  {c=0；

    for (i = 2; i < a; i++)
    {

      if (a % i == 0)
      {
        c++;
        break;
      }
    }

    if (c == 0)
    {
      break;
    }
  }
  printf("%d", a);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:6: error: invalid suffix "；" on integer constant
   10 |   {c=0；
      |      ^~~
main.c:10:9: error: expected ';' before 'for'
   10 |   {c=0；
      |         ^
      |         ;
   11 | 
   12 |     for (i = 2; i < a; i++)
      |     ~~~
Language: C++

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

#include <bitts/stdc++.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:9:10: fatal error: bitts/stdc++.h: No such file or directory
    9 | #include <bitts/stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.