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

#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>

#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int64_t a, b, k; cin >> a >> b >> k;
	int64_t r = min(k, a);
	a -= r;
	k -= r;

	b -= max(k, 0LL);
	cout << a << " " << b << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:17: error: no matching function for call to 'max(int64_t&, long long int)'
   43 |         b -= max(k, 0LL);
      |              ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:43:17: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   43 |         b -= max(k, 0LL);
      |              ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:13:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:43:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   43 |         b -= max(k, 0LL);
      |              ~~~^~~~~~~~
Language: C++

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

#define ff first
#define ss second
#define endl '\n'

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

	ll a, b, k;
	cin >> a >> b >> k;

	ll t = min(a, k);
	a -= t;
	k -= t;

	if (!a) {
		b -= k;
		b = max(0, b);
	}

	cout << a << ' ' << b << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: no matching function for call to 'max(int, ll&)'
   22 |                 b = max(0, b);
      |                     ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   22 |                 b = max(0, b);
      |                     ~~~^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   22 |                 b = max(0, b);
      |                     ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

using Graph=vector<vector<int>>;
Graph G;



int main(){
  ll a,b,k;
  cin >> a >> b >> k;
  if(a-k>=0){
    cout << a-k <<" "<<b <<endl;
  }
  else{
    cout << 0 << " " << max((ll)0,b-(a-k))<<endl;
}
    


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

#include <bits/stdc++.h>
#define r(i, n) for (ll i=0;i<n;i++)
#define ll long long
#define llc(n) ll n; cin >> n;
using namespace std;
int main() {
  ll a,b,k;
  cin >> a >> b >> k;
  r(i,n) {
    if(a!=0) a--;
    else if(b!=0) b--;
  }
  cout << a << " " << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'n' was not declared in this scope
    9 |   r(i,n) {
      |       ^
a.cc:2:31: note: in definition of macro 'r'
    2 | #define r(i, n) for (ll i=0;i<n;i++)
      |                               ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back

typedef long long ll;

const ll MOD = 1e9+7;

int main() {
	ll a, b, k;
  	if (k<=a) {
    	cout <<a-k<<" "<<b<<endl;
      	return 0;
    }
  	k -= a;
  	cout <<0<<" "<<max(0, b-k)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: no matching function for call to 'max(int, ll)'
   21 |         cout <<0<<" "<<max(0, b-k)<<endl;
      |                        ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:21:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   21 |         cout <<0<<" "<<max(0, b-k)<<endl;
      |                        ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:21:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   21 |         cout <<0<<" "<<max(0, b-k)<<endl;
      |                        ~~~^~~~~~~~
Language: C++

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

long long a, b, k;

int main() {
  cin >> a >> b >> k;
  a -= min(k, a);
  k -= min(k, a);
  b -= min(k, b);
  cout << a << ' ' << b << '\n';
}

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

#include<bits/stdc++.h>
using namespace std;
#define int long
signed main(){
    int a, b, k;
    cin >> a >> b >> k;
    if (a > k) a -= k;
    else k -= a, a = 0;
    b -= k;
    cout << max(a, 0ll) << " " << b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: no matching function for call to 'max(long int&, long long int)'
   10 |     cout << max(a, 0ll) << " " << b;
      |             ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:10:16: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   10 |     cout << max(a, 0ll) << " " << b;
      |             ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:10:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   10 |     cout << max(a, 0ll) << " " << b;
      |             ~~~^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
typedef long long ll;

int main(){
    ll a, b, k;
    cin >> a >> b >> k;
    ll tmp = min(a,k);
    a -= tmp;
    if(k-tmp > 0)   b = max(0, b-(k-tmp));
    cout << a << " " << b << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: no matching function for call to 'max(int, ll)'
   10 |     if(k-tmp > 0)   b = max(0, b-(k-tmp));
      |                         ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:10:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   10 |     if(k-tmp > 0)   b = max(0, b-(k-tmp));
      |                         ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C

#include<stdio.h>
int main()
{
long long int x;
scanf("%lld",&x);
bool s = true;
while(s)
{
  int t = 1;
  for(int i = 2;i<=x;i++)
    if(x%i == 0)
    {
      x++;
      t = 0;
      break;
    }
  if (t==0)
  {
    printf("%lld",x);
    s = false;
  }
}
}
      

Compiler output:
main.c: In function 'main':
main.c:6:1: error: unknown type name 'bool'
    6 | bool s = true;
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | int main()
main.c:6:10: error: 'true' undeclared (first use in this function)
    6 | bool s = true;
      |          ^~~~
main.c:6:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:9: error: 'false' undeclared (first use in this function)
   20 |     s = false;
      |         ^~~~~
main.c:20:9: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:15:5: error: expected declaration or statement at end of input
   15 |     printf("%d", i);
      |     ^~~~~~
Language: C++

# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
def is_prime(t):
    k = 2
    while k*k <= t:
        if t%k == 0:
            return False
        k+=1
    return True

x = int(input())
while True:
    if is_prime(x):
        print(x)
        break
    else:
        x+=1

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #Begin
    1 | # Begin Header {{{
      |   ^~~~~
a.cc:7:3: error: invalid preprocessing directive #}
    7 | # }}} End Header
      |   ^
a.cc:8:3: error: invalid preprocessing directive #_________\U000030b3\U000030fc\U000030c7\U000030a3\U000030f3\U000030b0\U0000306f\U00003053\U00003053\U0000304b\U00003089\U0000ff01\U0000ff01___________
    8 | # _________コーディングはここから！！___________
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:2:1: error: 'from' does not name a type
    2 | from math import gcd
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long ;
int main() {
  ll a;
  cin>>a;
  vector<ll>vec(5)={2,3,5,7,11};
  for(ll i=13;;i++){
    for(ll j=0;j<vec.size();j++){
      if(i%vec.at(j)==0)break;
      if(j==vec.size()-1){
        vec.push_back(i);
        if(a<=i){
          cout<<i<<endl;
          return 0;
        }
      }
    }
  }
    
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected ',' or ';' before '=' token
    7 |   vector<ll>vec(5)={2,3,5,7,11};
      |                   ^
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll c=0;
prime(ll a)
{
    ll j,k=0,i;
    for(i=2; i*i<=a; i++)
    {
        if(a%i==0)
        {
            k=1;
            break;
        }

    }
    if(k==0)
    {
        c=1;
       // cout<<a;
    }

}
int main()
{
    ll n,i,j,ans=0;
    ll a,b,k;
    cin>>n;

    for(i=n;i<=100003; i++)
    {
        prime(i);
        if(c==1)
        {
           cout<<i;
            return 0;
        }
    }
}


Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'prime' with no type [-fpermissive]
    5 | prime(ll a)
      | ^~~~~
a.cc: In function 'int prime(ll)':
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll c=0;
prime(ll a)
{
    ll j,k=0,i;
    for(i=2; i*i<=a; i++)
    {
        if(a%i==0 && i!=a)
        {
            k=1;
            break;
        }

    }
    if(k==0)
    {
        c=1;
        cout<<a;
    }

}
int main()
{
    ll n,i,j,ans=0;
    ll a,b,k;
    cin>>n;

    for(i=n;; i++)
    {
        prime(i);
        if(c==1)
        {
            //cout<<i;
            return 0;
        }
    }
}


Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'prime' with no type [-fpermissive]
    5 | prime(ll a)
      | ^~~~~
a.cc: In function 'int prime(ll)':
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
Language: C

#include<stdio.h>
int sosuu(int a)
{
  int k,sw;
  k=0;
  for(int i=2;i<a/2;++i)
  {
  if(a%i==0) {k++;
             printf("!%d",k);}
  }
  if(k>0) sw=1;
  else sw=0;
return sw;
}
int main()
{
int n,cc;
  cc=0;
  scanf("%d",&n);
  
  while(cc==0)
  {
  if(sosuu(n)==0) sw++;
  else n++;
  }
  printf("%d",n);
return 0;}

Compiler output:
main.c: In function 'main':
main.c:23:19: error: 'sw' undeclared (first use in this function)
   23 |   if(sosuu(n)==0) sw++;
      |                   ^~
main.c:23:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};
int main(void){
  int X;
  cin >> X;
  while (!isPrime(X)) X++;
  cout << X << endl;
  return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected unqualified-id before '=' token
    6 |   long long int = i, j;
      |                 ^
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i = X; i <= 100000; i++){
      |       ^
a.cc:10:9: error: 'j' was not declared in this scope
   10 |     for(j = 2 ;j <= i; j++){
      |         ^
a.cc:15:13: error: 'j' was not declared in this scope
   15 |     if(i == j)
      |             ^
a.cc:18:11: error: 'i' was not declared in this scope
   18 |   cout << i << endl;
      |           ^
Language: C

#include <stdio.h>

int main(){

    inta,count=0,i=2;

    scanf("%d",&a);

    while(1)

    {
        while(a>i){

            if(a%i==0 && a!=2){

                count++;


            }

        i++;

        }
            if(count==0)
            {
                break;

            }

    a++;
    i=2;
    count=0;

    }
        if(count==0){

        printf("%d\n",a);


    }



return 0;

}


Compiler output:
main.c: In function 'main':
main.c:5:5: error: 'inta' undeclared (first use in this function); did you mean 'int'?
    5 |     inta,count=0,i=2;
      |     ^~~~
      |     int
main.c:5:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:10: error: 'count' undeclared (first use in this function)
    5 |     inta,count=0,i=2;
      |          ^~~~~
main.c:5:18: error: 'i' undeclared (first use in this function)
    5 |     inta,count=0,i=2;
      |                  ^
main.c:7:17: error: 'a' undeclared (first use in this function)
    7 |     scanf("%d",&a);
      |                 ^
Language: C++

#include<stdio.h>///khata

isPrime(int n)
{
    int i;

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

int finding_prime(int n)
{
    while(isPrime(n) != 1)
    {
        n++;
    }

    return n;
}

int main()
{
    int x, returned;

    scanf("%d", &x);

    returned = isPrime(x);

    if(returned == 1)
        printf("%d\n", x);

    else if(returned == 0)
    {
        x=finding_prime(x);
    }

    if(returned == 0)
        printf("%d\n", x);

    return 0;
}







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

/*
======================
[     ___T_          ]
[    | 6=6 | =>HI :-)] 
[    |__o__|         ]
[ >===]__o[===<      ]
[     [o__]          ]
[      .".           ]
[      |_|           ]
[                    ]
======================
 */

#include<bits/stdc++.h>
using namespace std;
using lli = int64_t;
int main(){
	 ios::sync_with_stdio(false);
	 cin.tie(nullptr);
	 cout.tie(nullptr);
	 int T = 1;
	 for(int t = 1; t <= T; t++){
		 int x;
		 cin >> x;
		 if(x == 2){
			 cout << x << "\n";
			 return 0;
		 }
		 if(x == 3){
			 cout << x << "\n";
			 return 0;
		 }
		 for(int i = x; ; 
		 ue;
			 for(int j = 2; j * j <= i; j++){
				 if(i % j == 0){
					 yes = false;
					 break;
				 }
			 }
			 if(yes){
				 cout << i << "\n";
				 return 0;
			 }
		 }
	 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:18: error: 'ue' was not declared in this scope
   34 |                  ue;
      |                  ^~
a.cc:34:20: error: expected ')' before ';' token
   34 |                  ue;
      |                    ^
      |                    )
a.cc:33:21: note: to match this '('
   33 |                  for(int i = x; ;
      |                     ^
a.cc:35:50: error: 'i' was not declared in this scope
   35 |                          for(int j = 2; j * j <= i; j++){
      |                                                  ^
a.cc:37:42: error: 'yes' was not declared in this scope
   37 |                                          yes = false;
      |                                          ^~~
a.cc:41:29: error: 'yes' was not declared in this scope
   41 |                          if(yes){
      |                             ^~~
a.cc:42:42: error: 'i' was not declared in this scope
   42 |                                  cout << i << "\n";
      |                                          ^
a.cc: At global scope:
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C

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

int is_prime(int num);
int next_pr(int num);

int main()
{
    int num;
    scanf("%d", &num);
    printf("%d\n", next_pr(num));

    return 0;
}

int next_pr(int num)
{
    int c;
    if (num == 2)
        c = 3;
    else
    {
        num += 2;
        is_prime(num) ? next_pr(num) : c = num;
    }

    return c;
}

int is_prime(int num)
{
    int i;
    int c = 0;
    // printf ("%f\n", sqrt (num));
    for (i = 2; i <= sqrt(num); ++i)
    {
        if (num % i == 0)
            // printf ("%d\n",num%i);
            c++;
    }
    return c;
}

Compiler output:
main.c: In function 'next_pr':
main.c:24:42: error: lvalue required as left operand of assignment
   24 |         is_prime(num) ? next_pr(num) : c = num;
      |                                          ^
Language: C

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

int is_prime(int num);
int next_pr(int num);

int main()
{
    int num;
    scanf("%d", &num);
    printf("%d\n", next_pr(num));

    return 0;
}

int next_pr(int num)
{
    int c;
    if (num == 2)
        c = 3;
    else
    {
        num += 2;
        is_prime(num) ? next_pr(num) : c = num;
    }

    return c;
}

int is_prime(int num)
{
    int i;
    int c = 0;
    // printf ("%f\n", sqrt (num));
    for (i = 2; i <= sqrt(num); ++i)
    {
        if (num % i == 0)
            // printf ("%d\n",num%i);
            c++;
    }
    return c;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:10:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |     scanf("%d", &num);
      |     ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <math.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:10:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |     scanf("%d", &num);
      |     ^~~~~
main.c:10:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |     printf("%d\n", next_pr(num));
      |     ^~~~~~
main.c:11:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'next_pr':
main.c:24:42: error: lvalue required as left operand of assignment
   24 |         is_prime(num) ? next_pr(num) : c = num;
      |                                          ^
Language: C++

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

long long int A, B, K;

long long int max(long long int A, long long int B) { return A > B ? A : B; }

int main() {
    cin >> A >> B >> C;
    if (C >= A) cout << 0 << " " << max(0, B-(C-A));
    else cout << (long long) (A-C) << " " << B;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'C' was not declared in this scope
    9 |     cin >> A >> B >> C;
      |                      ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
#define all(i) i.begin(),i.end()
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


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

Compiler output:
a.cc: In function 'int main()':
a.cc:31:8: error: 'ju' was not declared in this scope; did you mean 'j'?
   31 |     if(ju){
      |        ^~
      |        j
Language: C++


#include <bits/stdc++.h>
#include <cmath>
using namespace std;
 
#define coutv(v) for (int i = 0; i < (v).size(); ++i) cout << v[i] << ' '; cout << endl;
#define coutvv(v) for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cout << v[i][j] << ' '; cout << endl;}
#define debugv(v) {for (int i = 0; i < (v).size(); ++i) cerr << v[i] << ' '; cerr << endl;}
#define debugvv(v) {for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cerr << v[i][j] << ' '; cerr << endl;}}
#define TC int TESTCASE; cin >> TESTCASE; while (TESTCASE--)
typedef long long ll;
 

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


int main() {
	int n;
	cin >> n;
	i = 0;
	while (!prime(n + i)) {
		i += 1;
	}
	cout << n + i;
}
 


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


#include <bits/stdc++.h>
#include <cmath>
using namespace std;
 
#define coutv(v) for (int i = 0; i < (v).size(); ++i) cout << v[i] << ' '; cout << endl;
#define coutvv(v) for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cout << v[i][j] << ' '; cout << endl;}
#define debugv(v) {for (int i = 0; i < (v).size(); ++i) cerr << v[i] << ' '; cerr << endl;}
#define debugvv(v) {for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cerr << v[i][j] << ' '; cerr << endl;}}
#define TC int TESTCASE; cin >> TESTCASE; while (TESTCASE--)
typedef long long ll;
 

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


int main() {
	int n;
	cin >> n;
	i = 0;
	while (!prime(n + i)) {
		i += 1;
	}
	cout << n + i;
}
 


Compiler output:
a.cc:14:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 | bool prime(n) {
      |            ^
      |            yn
a.cc: In function 'int main()':
a.cc:28:9: error: 'i' was not declared in this scope
   28 |         i = 0;
      |         ^
a.cc:29:28: error: 'prime' cannot be used as a function
   29 |         while (!prime(n + i)) {
      |                            ^
Language: C++

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


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'while'
   11 |   while(ans){
      |   ^~~~~
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int X = scan.nextInt();
        boolean ans = false;

        while(!(ans)) {
            if(PrimeNumber(X)) {
                ans = true;
                System.out.println(X);
            }
            X++;
        }
    }

    private static boolean PrimeNumber(int X) {
        for(int i = 2; i < x/2; i++) {
            if(x % i == 0){
                return false;
            }
        }
        return true;
    }
}

Compiler output:
Main.java:19: error: cannot find symbol
        for(int i = 2; i < x/2; i++) {
                           ^
  symbol:   variable x
  location: class Main
Main.java:20: error: cannot find symbol
            if(x % i == 0){
               ^
  symbol:   variable x
  location: class Main
2 errors
Language: Java

import java.math.*;
import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    BigInteger b=in.nextBigInteger();
    if(b.isProbablePrime(70)==true)
    {
      System.out.println(b);
    }
    else
    {
      System.out.println(b.nextProbablePrime());
    }
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    BigInteger b=in.nextBigInteger();
                 ^
  symbol:   variable in
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class TestC_149 {

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

		for(;;) {
			if(primeJudg(x)) {
				System.out.print(x);
				return;
			}
			else {
				x++;
			}
		}
	}

	//素数を判断するメソッド
	public static boolean primeJudg(int a){
		for(int i=2 ; i<a ; i++) {
			if(a%i == 0) {
				return false;
			}
		}
		return true;
	}
}

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

#include <iostream>
#include<math.h>
using namespace std;

//Compiler version g++ 6.3.0
int prime(int n){
  if(n==2)return 1;
  if(n%2==0)return -1;
  for(int i=3;i<=sqrt(n);i=i+2){
    if(n%i==0){
      return -1;
    }
  }
  return 1;
}
int main()
{
    int n;
    cin>>n;
    if(prime(n)==1){
      cout<<n;
    }
    else{
      while(1){
        n++;
        if(prime(n)==1){
          cout<<n;break;
        }
      }
    }
    return 0;
}

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

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

//Compiler version g++ 6.3.0
int prime(int n){
  if(n==2)return 1;
  if(n%2==0)return -1;
  for(int i=3;i<=sqrt(n);i=i+2){
    if(n%i==0){
      return -1;
    }
  }
  return 1;
}

int main()
{
    int n;
    cin>>n;
    if(prime(n)==1){
      cout<<n;
    }
    else{
      while(1){
        n++;
        if(prime(n)==1){
          cout<<n;break;
        }
      }
    }
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;
  int prime = 0;
  if(n==2 || n==3){cout<<n;return;}
  for(int i=n;i<10000000;i++){
  	int div=0;
  			for(int j=2;j*j<=i;j++){
            	if(i%j==0){div=1;break;}
            }
    if(div==0){prime=i;break;}
  }
  cout<<prime;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: return-statement with no value, in function returning 'int' [-fpermissive]
    6 |   if(n==2 || n==3){cout<<n;return;}
      |                            ^~~~~~
Language: C++

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


  int gcd(int a ,int b){
  	return(b);
  }else{
  	return(gcd(b,a%b));
  }


	int lcm(int a , int b){
    	return a*b / gcd(a,b);
    }

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

 int not_prime=0;
for(int j = X ; ; j++){  
  	for(int i = 2 ; i < Y ; i++){
  		if(gcd(Y,i)>1){
      		not_prime = 1;
    		break;
    	}
    	if(i == X-1){
    		cout << X << endl;
    	}
  	}
  		if(not_prime == 0){
  			break;
  		}  
  	   not_prime = 0;
  	   Y++;
	}  
}

Compiler output:
a.cc:7:4: error: expected unqualified-id before 'else'
    7 |   }else{
      |    ^~~~
Language: C++

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

  for(int i=X;i<=100000;i++){
    for(int i=2;i<X;i++){
      if(X%i==0){
        break;
      }
      if(i==X-1){
        cout<<X;
        return 0;
    }
  }
}

      


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

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

int main(){
  int X ;
  cin >> X ;
  int a =1;
  bool ans = true;
  for(int i=X;i<X+10000;i++){
    int x = sqrt(i);
    a = i ;
    for(int j=2;j<x;j++){
      if(X$j==0) {
        ans = false;
        break;
      }
    }
      if(ans) break;
  }
  
  cout << a << endl;
}

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

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define ll long long
#define be(v) v.begin(), v.end()
ll INF = 1000100100010;

int NextPrime(int num) {
	bool ok = false;
	while(ok=false) {
    if (num < 2) ok = false; continue;
    else if (num == 2) break;
    else if (num % 2 == 0) ok = false; continue;    //素数判定

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2) if (num % i == 0) ok = false; continue;
    ok = true; break;
	num ++;
	}
	return num;
}

int main() {
	int x; cin >> x;
	cout << NextPrime(x) << endl;
}

Compiler output:
a.cc: In function 'int NextPrime(int)':
a.cc:13:5: error: 'else' without a previous 'if'
   13 |     else if (num == 2) break;
      |     ^~~~
Language: C++

#include <iostream>
#include<vector>
using namespace std;
int main(void){
   int n;
   cin >> n;
   vector<bool> isPrime(10e5 + 1,true);
   isPrime[0] = isPrime[1] = false;
   for(int i = 2;i * i <= 100000;i++){
       for(int j = 2;i * j <= 100000;j++){
           isPrime[i * j] = false;
       }
   }
   
   for(int i = n;i <= 100000;i++){
       if(isPrime[i]){
           cout << i << endl;
           return;
       }
   }
   cout << 100003 <<endl;
    
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  
  
  queue<int> q;
  int i=x+1;
  while(i<10004 || q.empty()){
    int j=1;
    int num=0;
    while(j<i+1 || q.empty()){
  if(_gcd(i, j)==1){
    num++;
  }
  if(num==2){
    q.push(i);
  }
    }
    i++;
  }
    
  cout << q.front() << endl;

}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: '_gcd' was not declared in this scope
   15 |   if(_gcd(i, j)==1){
      |      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  
  
  queue<int> q;
  int i=x+1;
  while(i<10004 || q.empty()){
    int j=1;
    int num=0;
    while(j<i+1 || q.empty()){
  if(_gcd(i,j)==1){
    num++;
  }
  if(num==2){
    q.push(i);
  }
    }
    i++;
  }
    
  cout << q.top() << endl;

}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: '_gcd' was not declared in this scope
   15 |   if(_gcd(i,j)==1){
      |      ^~~~
a.cc:25:13: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   25 |   cout << q.top() << endl;
      |             ^~~
      |             pop
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  
  
  queue<int> q;
  int i=x+1;
  while(i<10004 || q.empty()){
    int j=1;
    int num=0;
    while(j<i+1 || q.empty()){
  if(_gcd(i,j)==1){
    num++;
  }
  if(num==2){
    q.insert(i);
  }
    }
    i++;
  }
    
  cout << q.top() << endl;

}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: '_gcd' was not declared in this scope
   15 |   if(_gcd(i,j)==1){
      |      ^~~~
a.cc:19:7: error: 'class std::queue<int>' has no member named 'insert'
   19 |     q.insert(i);
      |       ^~~~~~
a.cc:25:13: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   25 |   cout << q.top() << endl;
      |             ^~~
      |             pop
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  
  
  queue<int> q;
  int i=x+1;
  while(i<10004 || q.empty()){
    while(j<i+1 || q.empty()){
  if(_gcd(i,j)==1){
    num++;
  }
  if(num==2){
    q.insert(i);
  }
    }
    i++;
  }
    
  cout << q.top() << endl;

}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'j' was not declared in this scope
   12 |     while(j<i+1 || q.empty()){
      |           ^
a.cc:13:6: error: '_gcd' was not declared in this scope
   13 |   if(_gcd(i,j)==1){
      |      ^~~~
a.cc:14:5: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |     num++;
      |     ^~~
      |     enum
a.cc:16:6: error: 'num' was not declared in this scope; did you mean 'enum'?
   16 |   if(num==2){
      |      ^~~
      |      enum
a.cc:17:7: error: 'class std::queue<int>' has no member named 'insert'
   17 |     q.insert(i);
      |       ^~~~~~
a.cc:23:13: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   23 |   cout << q.top() << endl;
      |             ^~~
      |             pop
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  
  for(int i=x+1; i< 100004; i++){
    for(int j=1; j<i+1; j++){
      int sum=0;
      if(gcd(i,j)==1){
        sum++;
      }
    }
    if(sum==2){
      cout << i << endl;
      break;
    }
  }

}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'sum' was not declared in this scope
   15 |     if(sum==2){
      |        ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
  
  for(int i=x+1; i< 100004; i++){
    for(int j=1; j<i+1; j++){
      int sum=0;
      if(_gcd(i,j)==1){
        sum++;
      }
    }
    if(sum==2){
      cout << i << endl;
      break;
    }
  }

}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: '_gcd' was not declared in this scope
   11 |       if(_gcd(i,j)==1){
      |          ^~~~
a.cc:15:8: error: 'sum' was not declared in this scope
   15 |     if(sum==2){
      |        ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: break statement not within loop or switch
   18 |     break;
      |     ^~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: 'at' was not declared in this scope
   17 |   if(at=false) break;
      |      ^~
a.cc:17:16: error: break statement not within loop or switch
   17 |   if(at=false) break;
      |                ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
  int M = 0;
  cin >> M;
  int maxn = 100000;
  vector<bool> n;
  n.resize(maxn,1);
  
  for(int i = 2; i < maxn; i++){
    if(n[i]){
      if(M <= i){
        cout << i;
        return 0;
      }
    }
    for(int j=i; j<maxn; j += i){
      n[j] = 0;
    }
  }
  return 0;

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

#include <iostream>
#include <bitset>

using namespace std;

int main() {
  int64_t X;
  cin >> X;
  bitset<10000001> b;
  b.set(2);
  for (int64_t i = 3; i <= 10000000; i += 2) {
    for (int64_t j = i + i; j <= 10000000; j += i) {
      b.set(j);
    }
  }
  int result = max(X | 1, 2LL);
  while (b[result]) result += 2;
  cout << result << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: no matching function for call to 'max(int64_t, long long int)'
   16 |   int result = max(X | 1, 2LL);
      |                ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:19: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   16 |   int result = max(X | 1, 2LL);
      |                ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

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

int main() {
  int X;
  cin >> X;
  
  while(true) {
    if (isPrime(X)) {
      cout << X << endl;
      return 0;
    }
    X++;
  }
  
  
}

Compiler output:
a.cc: In function 'bool isPrime(int)':
a.cc:5:3: error: 'res' was not declared in this scope
    5 |   res = true;
      |   ^~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include <cstdio>
#include<cmath>
#define endl '\n'
#define sz 1000001
using namespace std;
typedef long long ll;
ll siv[sz],prime[sz],cnt;
ll:iterator it;
int main()
{
	ll limit = sqrt(sz+1);
	for(int i = 3; i<=limit; i++)
		if(!siv[i])
			for(int j = i*i; j<sz; j+=i+i)
				if(!siv[j])siv[j]=1;
	prime[cnt++]=2;
	for(int i = 3; i<sz; i+=2)
		if(!siv[i])prime[cnt++]=i;
	int x;
	cin>>x;
	it = lower_bound(prime.begin(),prime.end(),x);
	cout<<*it;
	return 0;
}

Compiler output:
a.cc:10:3: error: found ':' in nested-name-specifier, expected '::'
   10 | ll:iterator it;
      |   ^
      |   ::
a.cc:10:13: error: expected initializer before 'it'
   10 | ll:iterator it;
      |             ^~
a.cc: In function 'int main()':
a.cc:23:9: error: 'it' was not declared in this scope; did you mean 'int'?
   23 |         it = lower_bound(prime.begin(),prime.end(),x);
      |         ^~
      |         int
a.cc:23:32: error: request for member 'begin' in 'prime', which is of non-class type 'll [1000001]' {aka 'long long int [1000001]'}
   23 |         it = lower_bound(prime.begin(),prime.end(),x);
      |                                ^~~~~
a.cc:23:46: error: request for member 'end' in 'prime', which is of non-class type 'll [1000001]' {aka 'long long int [1000001]'}
   23 |         it = lower_bound(prime.begin(),prime.end(),x);
      |                                              ^~~