Language: C++

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<queue>
#include<set>
#define rep(i,s,t) for(register int i=s;i<=t;++i)
#define _rep(i,s,t) for(register int i=s;i>=t;--i)
#define Rep(i,s,t) for(register int i=s;i<t;++i)
#define go(x) for(register int e=las[x];e;e=nxt[e])
#define re register
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define gi(x) read(x)
#define gii(x,y) read(x),read(y)
#define giii(x,y,z) read(x),read(y),read(z)
#define ms(f,x) memset(f,x,sizeof f)
#define open(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
namespace IO{
    #define gc getchar()
    #define pc(x) putchar(x)
    template<typename T>inline void read(T &x){
        x=0;int f=1;char ch=gc;while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=gc;}
        while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=gc;x*=f;return;
    }
    template<typename T>inline void write(T x=0){
        T wr[51];wr[0]=0;if(x<0)pc('-'),x=-x;if(!x)pc(48);
        while(x)wr[++wr[0]]=x%10,x/=10;while(wr[0])pc(48+wr[wr[0]--]);
		putchar('\n');
		return;
    }
}
using IO::read;
using IO::write;
int a[2*n];
long long sum;
int main(){
    gi(n);
    rep(i,1,n+n)
        gi(a[i]);
    sort(a+1,a+n+n+1);
    for(int i=1;i<=n;i+=2)
        sum+=a[i];
    cout<<sum<<endl;
    return 0;
}


Compiler output:
a.cc:37:9: error: 'n' was not declared in this scope
   37 | int a[2*n];
      |         ^
a.cc: In function 'int main()':
a.cc:40:8: error: 'n' was not declared in this scope
   40 |     gi(n);
      |        ^
a.cc:16:20: note: in definition of macro 'gi'
   16 | #define gi(x) read(x)
      |                    ^
a.cc:41:9: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   41 |     rep(i,1,n+n)
      |         ^
a.cc:6:37: note: in definition of macro 'rep'
    6 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
      |                                     ^
a.cc:42:12: error: 'a' was not declared in this scope
   42 |         gi(a[i]);
      |            ^
a.cc:16:20: note: in definition of macro 'gi'
   16 | #define gi(x) read(x)
      |                    ^
a.cc:43:10: error: 'a' was not declared in this scope
   43 |     sort(a+1,a+n+n+1);
      |          ^
a.cc:43:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   43 |     sort(a+1,a+n+n+1);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:46:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   46 |     cout<<sum<<endl;
      |     ^~~~
      |     std::cout
In file included from a.cc:3:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:46:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   46 |     cout<<sum<<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)
      |     ^~~~