Language: C++

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

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

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

Compiler output:
a.cc: In function 'int eratos(long long int, std::vector<bool>)':
a.cc:6:9: error: 'faise' was not declared in this scope; did you mean 'raise'?
    6 |     s ={faise};
      |         ^~~~~
      |         raise
a.cc:6:14: error: no match for 'operator=' (operand types are 'std::vector<bool>' and '<brace-enclosed initializer list>')
    6 |     s ={faise};
      |              ^
In file included from /usr/include/c++/14/vector:67,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_bvector.h:894:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
  894 |       operator=(const vector& __x)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:894:31: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<bool>&'
  894 |       operator=(const vector& __x)
      |                 ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:926:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
  926 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:926:26: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<bool>&&'
  926 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:952:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]'
  952 |       operator=(initializer_list<bool> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:952:40: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<bool>'
  952 |       operator=(initializer_list<bool> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
a.cc: In function 'int main()':
a.cc:21:22: error: 'n' was not declared in this scope
   21 |     for(int i=x;i*i<=n;i++){
      |                      ^
a.cc:26:19: error: 'termx' was not declared in this scope; did you mean 'temx'?
   26 |             ans = termx;
      |                   ^~~~~
      |                   temx
a.cc:33:13: error: 'termx' was not declared in this scope; did you mean 'temx'?
   33 |             termx++;
      |             ^~~~~
      |             temx