Language: C++

#include<iostream>
using namespace std;

struct Card{ char suit, value;};

void bubble(struct Card A[], int N){
  Card tmp;

  for( i = 0; i < N-1; i ++){
    for( j = N-1; i < j; j--) {
      if (C[j].value < C[j-1].value) {
        tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
      }
    }
  }
}

void selection(struct Card A[], int N) {
  int minj;
  Card tmp;

  for ( i = 0; i < N-1; i++) {
    minj = i;
    for ( j = i; j < N-1; j++) {
      if ( C[j].value < C[minj].value ) minj = j;
    }
    tmp = C[i]; C[i] = C[mimj]; C[minj] = tmp;
}

void print(strudt  Card A[], int N) {
  for ( int i = 0; i < N; i++) {
    if ( i > 0 ) cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}      

bool isStable(struct Card C1[], struct Card C2[], int N) {
  for ( int i = 0; i < N; i++) {
    if ( C1[i].suit != C2[i].suit ) return false;
  }
  return true;
}

int main() {
  Card C1[100], C2[100];
  int N;
  char ch;

  cin >> N;
  for ( int i = 0; i < N; i++ ) {
    cin >> C1[i].suit >> C1[i].value;
  }

  for ( int i = 0; i < N; i++ ) C2[i] = C1[i];

  bubble(C1, N);
  selection(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 bubble(Card*, int)':
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for( i = 0; i < N-1; i ++){
      |        ^
a.cc:10:10: error: 'j' was not declared in this scope
   10 |     for( j = N-1; i < j; j--) {
      |          ^
a.cc:11:11: error: 'C' was not declared in this scope
   11 |       if (C[j].value < C[j-1].value) {
      |           ^
a.cc: In function 'void selection(Card*, int)':
a.cc:22:9: error: 'i' was not declared in this scope
   22 |   for ( i = 0; i < N-1; i++) {
      |         ^
a.cc:24:11: error: 'j' was not declared in this scope
   24 |     for ( j = i; j < N-1; j++) {
      |           ^
a.cc:25:12: error: 'C' was not declared in this scope
   25 |       if ( C[j].value < C[minj].value ) minj = j;
      |            ^
a.cc:27:11: error: 'C' was not declared in this scope
   27 |     tmp = C[i]; C[i] = C[mimj]; C[minj] = tmp;
      |           ^
a.cc:27:26: error: 'mimj' was not declared in this scope; did you mean 'minj'?
   27 |     tmp = C[i]; C[i] = C[mimj]; C[minj] = tmp;
      |                          ^~~~
      |                          minj
a.cc:30:6: error: variable or field 'print' declared void
   30 | void print(strudt  Card A[], int N) {
      |      ^~~~~
a.cc:30:12: error: 'strudt' was not declared in this scope; did you mean 'struct'?
   30 | void print(strudt  Card A[], int N) {
      |            ^~~~~~
      |            struct
a.cc:30:30: error: expected primary-expression before 'int'
   30 | void print(strudt  Card A[], int N) {
      |                              ^~~
a.cc:38:58: error: a function-definition is not allowed here before '{' token
   38 | bool isStable(struct Card C1[], struct Card C2[], int N) {
      |                                                          ^
a.cc:45:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   45 | int main() {
      |         ^~
a.cc:45:9: note: remove parentheses to default-initialize a variable
   45 | int main() {
      |         ^~
      |         --
a.cc:45:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:45:12: error: a function-definition is not allowed here before '{' token
   45 | int main() {
      |            ^
a.cc:70:2: error: expected '}' at end of input
   70 | }
      |  ^
a.cc:18:40: note: to match this '{'
   18 | void selection(struct Card A[], int N) {
      |                                        ^