Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
#define MAX 100
using namespace std;

struct Card { char suit, value; };

void bubbleSort(struct Card C[], int N) {
  REP (int i, N) {
    for (int j = N - 1; j >= i + 1; j--) {
      if (C[j].value < C[j - 1]) {
        Card temp = C[j];
        C[j] = C[j - 1];
        C[j - 1] = temp;
      }
    }
  }
}

void selectionSort(struct Card C[], int N) {
  REP (int i, N) {
    int minj = i;
    FOR (int j, i, N) {
      if (C[j].value < C[minj].value) {
        minj = j;
      }
    }
    Card temp = C[i];
    C[i] = C[minj];
    C[minj] = temp;
  }
}

void print(struct Card C[], int N) [
  REP (int i, N) {
    if (i > 0) cout << " ";
    cout << C[i].suit << C[i].value;
  }
  cout << endl;
}

bool isStable (struct Card C1[], struct Card C2[], int N) {
  REP (int i, N) {
    if (C1[i].suit != C2[i].suit) {
      return false;
    }
  }
  return true;
}
  
  
int main() {
  Card C1[MAX], C2[MAX];
  int N;
  
  cin >> N;
  REP (int i, N) {
    cin >> C1[i].suit >> C1[i].value;
    C2[i] = C1[i];
  }

  bubbleSort(C1, N);
  selectionSort(C2, N);

  print(C1, N);
  cout << "Stable" << endl;
  print(C2, N);
  if (isStable(C1, C2, N)) {
    cout << "Stable" << endl;
  } else {
    cout << "Not stable" << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:2:22: error: two or more data types in declaration of 'i'
    2 | #define ll long long int
      |                      ^~~
a.cc:3:24: note: in expansion of macro 'll'
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                        ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'REP'
   12 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected initializer before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'REP'
   12 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected ';' before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'REP'
   12 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected primary-expression before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'REP'
   12 |   REP (int i, N) {
      |   ^~~
a.cc:3:46: error: expected ')' before ';' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                       ~                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'REP'
   12 |   REP (int i, N) {
      |   ^~~
a.cc:3:48: error: expected initializer before '++' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                                ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'REP'
   12 |   REP (int i, N) {
      |   ^~~
a.cc: In function 'void selectionSort(Card*, int)':
a.cc:2:22: error: two or more data types in declaration of 'i'
    2 | #define ll long long int
      |                      ^~~
a.cc:3:24: note: in expansion of macro 'll'
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                        ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:24:3: note: in expansion of macro 'REP'
   24 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected initializer before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:24:3: note: in expansion of macro 'REP'
   24 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected ';' before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:24:3: note: in expansion of macro 'REP'
   24 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected primary-expression before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:24:3: note: in expansion of macro 'REP'
   24 |   REP (int i, N) {
      |   ^~~
a.cc:3:46: error: expected ')' before ';' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                       ~                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:24:3: note: in expansion of macro 'REP'
   24 |   REP (int i, N) {
      |   ^~~
a.cc:3:48: error: expected initializer before '++' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                                ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:24:3: note: in expansion of macro 'REP'
   24 |   REP (int i, N) {
      |   ^~~
a.cc: At global scope:
a.cc:3:20: error: expected primary-expression before 'for'
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                    ^~~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:38:3: note: in expansion of macro 'REP'
   38 |   REP (int i, N) {
      |   ^~~
a.cc:37:37: error: expected ']' before 'for'
   37 | void print(struct Card C[], int N) [
      |                                     ^
      |                                     ]
a.cc:3:38: error: expected initializer before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:38:3: note: in expansion of macro 'REP'
   38 |   REP (int i, N) {
      |   ^~~
a.cc:3:48: error: expected initializer before '++' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                                ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:38:3: note: in expansion of macro 'REP'
   38 |   REP (int i, N) {
      |   ^~~
a.cc:42:3: error: 'cout' does not name a type
   42 |   cout << endl;
      |   ^~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:2:22: error: two or more data types in declaration of 'i'
    2 | #define ll long long int
      |                      ^~~
a.cc:3:24: note: in expansion of macro 'll'
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                        ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:46:3: note: in expansion of macro 'REP'
   46 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected initializer before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:46:3: note: in expansion of macro 'REP'
   46 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected ';' before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:46:3: note: in expansion of macro 'REP'
   46 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected primary-expression before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:46:3: note: in expansion of macro 'REP'
   46 |   REP (int i, N) {
      |   ^~~
a.cc:3:46: error: expected ')' before ';' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                       ~                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:46:3: note: in expansion of macro 'REP'
   46 |   REP (int i, N) {
      |   ^~~
a.cc:3:48: error: expected initializer before '++' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                                ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:46:3: note: in expansion of macro 'REP'
   46 |   REP (int i, N) {
      |   ^~~
a.cc: In function 'int main()':
a.cc:2:22: error: two or more data types in declaration of 'i'
    2 | #define ll long long int
      |                      ^~~
a.cc:3:24: note: in expansion of macro 'll'
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                        ^~
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:60:3: note: in expansion of macro 'REP'
   60 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected initializer before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:60:3: note: in expansion of macro 'REP'
   60 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected ';' before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:60:3: note: in expansion of macro 'REP'
   60 |   REP (int i, N) {
      |   ^~~
a.cc:3:38: error: expected primary-expression before '<' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:60:3: note: in expansion of macro 'REP'
   60 |   REP (int i, N) {
      |   ^~~
a.cc:3:46: error: expected ')' before ';' token
    3 | #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
      |                       ~                      ^
a.cc:4:18: note: in expansion of macro 'FOR'
    4 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:60:3: note: in