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;
	}
	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:4:1: error: 'Struct' does not name a type; did you mean 'struct'?
    4 | Struct Card{ char suit,value; };
      | ^~~~~~
      | struct
a.cc: In function 'void bubble(Card*, int)':
a.cc:9:32: error: invalid use of incomplete type 'struct Card'
    9 |                         if (A[j].value < A[j - 1].value) {
      |                                ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:9:32: error: invalid use of incomplete type 'struct Card'
    9 |                         if (A[j].value < A[j - 1].value) {
      |                             ~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:9:49: error: invalid use of incomplete type 'struct Card'
    9 |                         if (A[j].value < A[j - 1].value) {
      |                                                 ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
cc1plus: error: invalid use of incomplete type 'struct Card'
a.cc:6:20: note: forward declaration of 'struct Card'
a.cc:9:49: error: invalid use of incomplete type 'struct Card'
    9 |                         if (A[j].value < A[j - 1].value) {
      |                                          ~~~~~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:10:38: error: variable 'Card t' has initializer but incomplete type
   10 |                                 Card t = A[j];
      |                                      ^
a.cc:10:45: error: invalid use of incomplete type 'struct Card'
   10 |                                 Card t = A[j];
      |                                             ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:11:36: error: invalid use of incomplete type 'struct Card'
   11 |                                 A[j] = A[j - 1];
      |                                    ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:11:47: error: invalid use of incomplete type 'struct Card'
   11 |                                 A[j] = A[j - 1];
      |                                               ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
cc1plus: error: invalid use of incomplete type 'struct Card'
a.cc:6:20: note: forward declaration of 'struct Card'
a.cc:11:36: error: invalid use of incomplete type 'struct Card'
   11 |                                 A[j] = A[j - 1];
      |                                 ~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:12:40: error: invalid use of incomplete type 'struct Card'
   12 |                                 A[j - 1] = t;
      |                                        ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
cc1plus: error: invalid use of incomplete type 'struct Card'
a.cc:6:20: note: forward declaration of 'struct Card'
a.cc: In function 'void selection(Card*, int)':
a.cc:22:32: error: invalid use of incomplete type 'struct Card'
   22 |                         if (A[j].value < A[minj].value)
      |                                ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:22:32: error: invalid use of incomplete type 'struct Card'
   22 |                         if (A[j].value < A[minj].value)
      |                             ~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:22:48: error: invalid use of incomplete type 'struct Card'
   22 |                         if (A[j].value < A[minj].value)
      |                                                ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:22:48: error: invalid use of incomplete type 'struct Card'
   22 |                         if (A[j].value < A[minj].value)
      |                                          ~~~~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:25:22: error: variable 'Card t' has initializer but incomplete type
   25 |                 Card t = A[i];
      |                      ^
a.cc:25:29: error: invalid use of incomplete type 'struct Card'
   25 |                 Card t = A[i];
      |                             ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:26:20: error: invalid use of incomplete type 'struct Card'
   26 |                 A[i] = A[minj];
      |                    ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:26:30: error: invalid use of incomplete type 'struct Card'
   26 |                 A[i] = A[minj];
      |                              ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:26:20: error: invalid use of incomplete type 'struct Card'
   26 |                 A[i] = A[minj];
      |                 ~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:27:23: error: invalid use of incomplete type 'struct Card'
   27 |                 A[minj] = t;
      |                       ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc: At global scope:
a.cc:30:6: error: variable or field 'print' declared void
   30 | void print(Struct Card A[], int N) {
      |      ^~~~~
a.cc:30:12: error: 'Struct' was not declared in this scope; did you mean 'struct'?
   30 | void print(Struct Card A[], int N) {
      |            ^~~~~~
      |            struct
a.cc:30:29: error: expected primary-expression before 'int'
   30 | void print(Struct Card A[], int N) {
      |                             ^~~
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:40:25: error: invalid use of incomplete type 'struct Card'
   40 |                 if (C1[i].suit != C2[i].suit)return false;
      |                         ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:40:25: error: invalid use of incomplete type 'struct Card'
   40 |                 if (C1[i].suit != C2[i].suit)return false;
      |                     ~~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:40:39: error: invalid use of incomplete type 'struct Card'
   40 |                 if (C1[i].suit != C2[i].suit)return false;
      |                                       ^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc:40:39: error: invalid use of incomplete type 'struct Card'
   40 |                 if (C1[i].suit != C2[i].suit)return false;
      |                                   ~~~~^
a.cc:6:20: note: forward declaration of 'struct Card'
    6 | void bubble(struct Card A[], int N) {
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:46:14: error: elements of array 'Card C1 [100]' have incomplete type
   46 |         Card C1[100], C2[100];
      |              ^~
a.cc:46:14: error: storage size of 'C1' isn't known
a.cc:46:23: error: elements of array 'Card C2 [100]' have incomplete type
   46 |         Card C1[100], C2[100];
      |                       ^~
a.cc:46:23: error: storage size of 'C2' isn't known
a.cc:60:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   60 |         print(C1, N);
      |         ^~~~~
      |         printf