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 = 0; 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 << end1;
}

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(void)  {
	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);
		
		printf(C1, n);
		cout << "Stable" << end1;
		printf(C2, n);
		if (isStable(C1, C2, n))  {
			cout << "Stable" << end1;
		} else {
			out << "Not stable" << end1;
	}		
	return 0;
}



				

Compiler output:
a.cc: In function 'void bubble(Card*, int)':
a.cc:8:54: error: expected ')' before ';' token
    8 |                 for (int  j = 0; j < n - 1; j > i + 1; j--)     {
      |                     ~                                ^
      |                                                      )
a.cc:8:56: error: 'j' was not declared in this scope
    8 |                 for (int  j = 0; j < n - 1; j > i + 1; j--)     {
      |                                                        ^
a.cc: In function 'void print(Card*, int)':
a.cc:37:17: error: 'end1' was not declared in this scope
   37 |         cout << end1;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:64:24: error: cannot convert 'Card*' to 'const char*'
   64 |                 printf(C1, n);
      |                        ^~
      |                        |
      |                        Card*
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:65:37: error: 'end1' was not declared in this scope
   65 |                 cout << "Stable" << end1;
      |                                     ^~~~
a.cc:66:24: error: cannot convert 'Card*' to 'const char*'
   66 |                 printf(C2, n);
      |                        ^~
      |                        |
      |                        Card*
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:70:25: error: 'out' was not declared in this scope
   70 |                         out << "Not stable" << end1;
      |                         ^~~