Language: C++

#include <iostream>
#include <vector>

void sieve(vector<int> &primes) {
  primes.resize(55556, 1);
  primes[0] = primes[1] = 0;
  for(int i = 2; i < 55556; i++) {
    if (primes[i]) {
      for(int j = i + i; j < 55556; j += i) {
        primes[j] = 0;
      }
    }
  }
}

int main() {
  vector<int> primes;
  sieve(primes);
  int N;
  cin >> N;
  int now = 0;
  vector<int> ans;
  for(int i = 0; i < primes.size(); i++) {
  	if (primes[i] % 5 == 1) {
      now++;
      ans.push_back(primes[i]);
    }
  }
  for(int i = 0; i < ans.size(); i++) {
  	cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc:4:6: error: variable or field 'sieve' declared void
    4 | void sieve(vector<int> &primes) {
      |      ^~~~~
a.cc:4:12: error: 'vector' was not declared in this scope
    4 | void sieve(vector<int> &primes) {
      |            ^~~~~~
a.cc:4:12: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:4:19: error: expected primary-expression before 'int'
    4 | void sieve(vector<int> &primes) {
      |                   ^~~
a.cc: In function 'int main()':
a.cc:17:3: error: 'vector' was not declared in this scope
   17 |   vector<int> primes;
      |   ^~~~~~
a.cc:17:3: note: suggested alternatives:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:17:10: error: expected primary-expression before 'int'
   17 |   vector<int> primes;
      |          ^~~
a.cc:18:9: error: 'primes' was not declared in this scope
   18 |   sieve(primes);
      |         ^~~~~~
a.cc:18:3: error: 'sieve' was not declared in this scope
   18 |   sieve(primes);
      |   ^~~~~
a.cc:20:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   20 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:22:10: error: expected primary-expression before 'int'
   22 |   vector<int> ans;
      |          ^~~
a.cc:26:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |       ans.push_back(primes[i]);
      |       ^~~
      |       abs
a.cc:29:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |   for(int i = 0; i < ans.size(); i++) {
      |                      ^~~
      |                      abs
a.cc:30:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   30 |         cout << ans[i] << " ";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:32:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   32 |   cout << 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:32:11: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   32 |   cout << 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)
      |     ^~~~