Language: C++

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

/* REPmacro */
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i)

/*alias*/
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define F first
#define S second
#define PB push_back
#define MP make_pair 

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

/*using*/
using ll = long long;
using ull = unsigned long long;
using unsi = unsigned;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using db = double;
using plex = complex<double>;
using vs = vector<string>;

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

/* func */

/*struct*/
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const db EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

//#define int ll
//#define int long long

int take(int &c, vi v1)[
  
  c += *max_element(ALL(v1));
  int *d = max_element(ALL(v1));
  *d = 0;
  return 0;
  }

signed main()
{
  int n; cin >> n;
  vi v1(n,0);
  for(auto &i:v1)
  cin >> i;
  int a = 0,b = 0;
  int cnt = 0;
  
  while(cnt < n){
   take(a,v1);
    ++cnt;
   take(b,v1);
    ++cnt;
  }
  
  return 0;
}

Compiler output:
a.cc:61:3: error: 'c' was not declared in this scope
   61 |   c += *max_element(ALL(v1));
      |   ^
a.cc:61:25: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   61 |   c += *max_element(ALL(v1));
      |                         ^~
a.cc:10:17: note: in definition of macro 'ALL'
   10 | #define ALL(x) (x).begin(),(x).end()
      |                 ^
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:61:25: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   61 |   c += *max_element(ALL(v1));
      |                         ^~
a.cc:10:29: note: in definition of macro 'ALL'
   10 | #define ALL(x) (x).begin(),(x).end()
      |                             ^
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:61:29: error: expected ']' before ';' token
   61 |   c += *max_element(ALL(v1));
      |                             ^
      |                             ]
a.cc:62:28: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   62 |   int *d = max_element(ALL(v1));
      |                            ^~
a.cc:10:17: note: in definition of macro 'ALL'
   10 | #define ALL(x) (x).begin(),(x).end()
      |                 ^
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:62:28: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   62 |   int *d = max_element(ALL(v1));
      |                            ^~
a.cc:10:29: note: in definition of macro 'ALL'
   10 | #define ALL(x) (x).begin(),(x).end()
      |                             ^
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:63:6: error: expected constructor, destructor, or type conversion before '=' token
   63 |   *d = 0;
      |      ^
a.cc:64:3: error: expected unqualified-id before 'return'
   64 |   return 0;
      |   ^~~~~~
a.cc:65:3: error: expected declaration before '}' token
   65 |   }
      |   ^
a.cc: In function 'int main()':
a.cc:77:4: error: 'take' was not declared in this scope
   77 |    take(a,v1);
      |    ^~~~