Language: C++

#include<iostream>
using namespace std;

struct Card{char suit, value; };

void bubble(struct Card A[], int N){
  for (int i = 0; i < N ; i++){
      for (int j = N - 1; j >= i + 1; j--){
       if(A[j].value < A[j - 1].value){
         Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
        }
      }
   }
}

void selection(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){ 
        if(A[j].value < A[minj].value) minj = j;
        }
       Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
    }
 }

void print(struct 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;
     }
   retrun 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 selection(Card*, int)':
a.cc:22:48: error: expected primary-expression before '=' token
   22 |        Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
      |                                                ^
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:38:4: error: 'retrun' was not declared in this scope
   38 |    retrun true;
      |    ^~~~~~
a.cc: At global scope:
a.cc:51:5: error: expected unqualified-id before 'for'
   51 |     for(int i= 0; i < N; i++) C2[i] = C1[i];
      |     ^~~
a.cc:51:19: error: 'i' does not name a type
   51 |     for(int i= 0; i < N; i++) C2[i] = C1[i];
      |                   ^
a.cc:51:26: error: 'i' does not name a type
   51 |     for(int i= 0; i < N; i++) C2[i] = C1[i];
      |                          ^
a.cc:53:14: error: expected constructor, destructor, or type conversion before '(' token
   53 |        bubble(C1, N);
      |              ^
a.cc:54:17: error: expected constructor, destructor, or type conversion before '(' token
   54 |        selection(C2, N);
      |                 ^
a.cc:56:10: error: expected constructor, destructor, or type conversion before '(' token
   56 |     print(C1, N);
      |          ^
a.cc:57:5: error: 'cout' does not name a type
   57 |     cout << "stable" << endl;
      |     ^~~~
a.cc:58:10: error: expected constructor, destructor, or type conversion before '(' token
   58 |     print(C2, N);
      |          ^
a.cc:59:5: error: expected unqualified-id before 'if'
   59 |     if(isStable(C1, C2, N)){
      |     ^~
a.cc:61:5: error: expected unqualified-id before 'else'
   61 |    }else{
      |     ^~~~
a.cc:65:1: error: expected unqualified-id before 'return'
   65 | return 0;
      | ^~~~~~
a.cc:66:1: error: expected declaration before '}' token
   66 | }
      | ^
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^