Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

Struct Card {
	unsigned int c;
	unsigned int n;
};
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];

bublesort(unsigned char d[][2], n)
{
	unsigned int num = 0;

	bool flag = true;
	while (flag) {
		flag = false;
		for (unsigned int i = n-1; i > 0; --i) {
			if (d[i][1] < d[i-1][1]) {
				char x = d[i-1][1];
				char y = d[i-1][0];
				d[i-1][0] = d[i][0];
				d[i-1][1] = d[i][1];
				d[i][0] = y;
				d[i][1] = x;
				flag = true;
				++num;
			}
		}
	}

	return num;
}

unsigned int selectionsort(unsigned char d[][2], n)
{
	unsigned int num = 0;
	for (unsigned int i = 0; i < n; ++i) {
		unsigned int minj = i;
		for (unsigned int j = i+1; j < n; ++j) {
			if (d[j][1] < d[minj][1]) {
				minj = j;
			}
		}
		if (i != minj) {
			char s = d[i][0];
			char t = d[i][1];
			d[i][0] = d[minj][0];
			d[i][1] = d[minj][1];
			d[minj][0] = s;
			d[minj][1] = t;
			++num;
		}
	}

	return num;
}

int main()
{
	unsigned int n;
	unsigned int num;
	cin >> n;
	for (unsigned int i = 0; i < n; ++i) {
		cin >> e[i][];
		d[i][0] = e[i][0];
		d[i][1] = e[i][1];
	}

	num = bublesort(e, n);
	for (unsigned int i = 0; i < n - 1; ++i)
		cout << e[i] << " ";
	cout << e[n-1] << "\n" << num << "\n";
	cout << "Stable"<< endl;

	num = selectionsort(d, n);
	for (unsigned int i = 0; i < n - 1; ++i)
		cout << d[i] << " ";
	cout << d[n-1] << "\n" << num << endl;
	bool bStable = true;
	for (unsigned int i = 0; i < n - 1; ++i)
		if (d[i] != e[i])
			eStable = false;

	if (eStable)
		cout << "Stable"<< endl;
	else
		cout << "Not stable"<< endl;

		
	return 0;
}



Compiler output:
a.cc:6:1: error: 'Struct' does not name a type; did you mean 'struct'?
    6 | Struct Card {
      | ^~~~~~
      | struct
a.cc:15:33: error: 'n' has not been declared
   15 | bublesort(unsigned char d[][2], n)
      |                                 ^
a.cc:15:1: error: ISO C++ forbids declaration of 'bublesort' with no type [-fpermissive]
   15 | bublesort(unsigned char d[][2], n)
      | ^~~~~~~~~
a.cc: In function 'int bublesort(unsigned char (*)[2], int)':
a.cc:22:39: error: 'n' was not declared in this scope
   22 |                 for (unsigned int i = n-1; i > 0; --i) {
      |                                       ^
a.cc: At global scope:
a.cc:39:50: error: 'n' has not been declared
   39 | unsigned int selectionsort(unsigned char d[][2], n)
      |                                                  ^
a.cc: In function 'unsigned int selectionsort(unsigned char (*)[2], int)':
a.cc:42:38: error: 'n' was not declared in this scope
   42 |         for (unsigned int i = 0; i < n; ++i) {
      |                                      ^
a.cc: In function 'int main()':
a.cc:69:29: error: expected primary-expression before ']' token
   69 |                 cin >> e[i][];
      |                             ^
a.cc:87:25: error: 'eStable' was not declared in this scope; did you mean 'bStable'?
   87 |                         eStable = false;
      |                         ^~~~~~~
      |                         bStable
a.cc:89:13: error: 'eStable' was not declared in this scope; did you mean 'bStable'?
   89 |         if (eStable)
      |             ^~~~~~~
      |             bStable