Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define fo(i,s,e) for (int i=(s); i < (e); i++)
#define all(obj) (obj).begin(), (obj).end()
#define int long long 卍卍卍
signed main () {
  int n;cin >> n;
  int a[n];
  int f=0;
  int s=0;
  rep(i,n){
    cin >> a[i];
    if(a[i] >= a[f]){
      s=f;
      f=i;
    }
    else if(a[i] >= a[s]){
      s=i;
    }
  }
  rep(i,n){
    i==f ? cout << a[s] <<endl : cout << a[f] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: expected initializer before 'n'
    8 |   int n;cin >> n;
      |       ^
a.cc:8:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |   int n;cin >> n;
      |                ^
      |                yn
a.cc:9:7: error: expected initializer before 'a'
    9 |   int a[n];
      |       ^
a.cc:10:7: error: expected initializer before 'f'
   10 |   int f=0;
      |       ^
a.cc:11:7: error: expected initializer before 's'
   11 |   int s=0;
      |       ^
a.cc:12:7: error: expected ';' before 'i'
   12 |   rep(i,n){
      |       ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                           ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   rep(i,n){
      |       ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                           ^
a.cc:6:13: error: expected primary-expression before 'long'
    6 | #define int long long 卍卍卍
      |             ^~~~
a.cc:3:37: note: in expansion of macro 'int'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                     ^~~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,n){
      |   ^~~
a.cc:6:13: error: expected ')' before 'long'
    6 | #define int long long 卍卍卍
      |             ^~~~
a.cc:3:37: note: in expansion of macro 'int'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                     ^~~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,n){
      |   ^~~
a.cc:3:36: note: to match this '('
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                    ^
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,n){
      |   ^~~
a.cc:3:44: error: expected ')' before ';' token
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                      ~                     ^
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,n){
      |   ^~~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   rep(i,n){
      |       ^
a.cc:3:46: note: in definition of macro 'rep'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                              ^
a.cc:22:7: error: expected ';' before 'i'
   22 |   rep(i,n){
      |       ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                           ^
a.cc:6:13: error: expected primary-expression before 'long'
    6 | #define int long long 卍卍卍
      |             ^~~~
a.cc:3:37: note: in expansion of macro 'int'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                     ^~~
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(i,n){
      |   ^~~
a.cc:6:13: error: expected ')' before 'long'
    6 | #define int long long 卍卍卍
      |             ^~~~
a.cc:3:37: note: in expansion of macro 'int'
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                     ^~~
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(i,n){
      |   ^~~
a.cc:3:36: note: to match this '('
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                                    ^
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(i,n){
      |   ^~~
a.cc:3:44: error: expected ')' before ';' token
    3 | #define rep(i,n) for (int i=0; i < (int)(n); i++)
      |                      ~                     ^
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(i,n){
      |   ^~~