Language: C++

#include <iostream>
using namespace std;

#define MAX = 36;

int N;
pair<char, int> = arr_bubble[MAX];
pair<char, int> = arr_selection[MAX];

void bubble_sort();
void selection_sort();

int main(){
	
	char type;
	int number;
	
	cin >> N;
	
	for(int i=0; i<N; i++){
		cin >> type;
		cin >> number;
		
		arr_bubble[i].first = type;
		arr_bubble[i].second = number;
		
		arr_selection[i].first = type;
		arr_selection[i].second = number;
	}
	
	bubble_sort();
	selection_sort();
	
	for(int i=0; i<N; i++){
		if(i==0){
			cout << arr_bubble[i].first << arr_bubble[i].second;
		}
		else{
			cout << " " << arr_bubble[i].first << arr_bubble[i].second;
		}
	}
	cout << endl;
	
	cout << "Stable" << endl;
	
	bool is_stable = true;
	for(int i=0; i<N; i++){
		if(arr_selection[i].first != arr_bubble[i].first) {
			is_stable = false;
			break;
		}
	}
	
	
	for(int i=0; i<N; i++){
		if(i==0){
			cout << arr_selection[i].first << arr_selection[i].second;
		}
		else{
			cout << " " << arr_selection[i].first << arr_selection[i].second;
		}
	}
	cout << endl;
	
	if(is_stable){
		cout << "Stable" << endl;
	}
	else{
		cout << "Not Stable" << endl;
	}
	
	void bubble_sort(){
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(arr_bubble[j-1].second > arr_bubble[j].second){
					pair<char, int> tmp;
					tmp = arr_bubble[j];
					arr_bubble[j] = arr_bubble[j-1];
					arr_bubble[j-1] = tmp;
				}
			}
		}
	}
	
	void selection_sort(){
		for(int i=0; i<N; i++){
			int mini = i;
			for(int j=i; j<N; j++){
				if(arr_selection[mini].second > arr_selection[j].second){
					mini = j;
				}
			}
			pair<char, int> tmp;
			tmp = arr_selection[i];
			arr_selection[i] = arr_selection[mini];
			arr_selection[mini] = tmp;
		}
	}
	
}

Compiler output:
a.cc:7:17: error: expected unqualified-id before '=' token
    7 | pair<char, int> = arr_bubble[MAX];
      |                 ^
a.cc:7:33: error: expected unqualified-id before ']' token
    7 | pair<char, int> = arr_bubble[MAX];
      |                                 ^
a.cc:8:17: error: expected unqualified-id before '=' token
    8 | pair<char, int> = arr_selection[MAX];
      |                 ^
a.cc:8:36: error: expected unqualified-id before ']' token
    8 | pair<char, int> = arr_selection[MAX];
      |                                    ^
a.cc: In function 'int main()':
a.cc:24:17: error: 'arr_bubble' was not declared in this scope
   24 |                 arr_bubble[i].first = type;
      |                 ^~~~~~~~~~
a.cc:27:17: error: 'arr_selection' was not declared in this scope
   27 |                 arr_selection[i].first = type;
      |                 ^~~~~~~~~~~~~
a.cc:36:33: error: 'arr_bubble' was not declared in this scope
   36 |                         cout << arr_bubble[i].first << arr_bubble[i].second;
      |                                 ^~~~~~~~~~
a.cc:39:40: error: 'arr_bubble' was not declared in this scope
   39 |                         cout << " " << arr_bubble[i].first << arr_bubble[i].second;
      |                                        ^~~~~~~~~~
a.cc:48:20: error: 'arr_selection' was not declared in this scope
   48 |                 if(arr_selection[i].first != arr_bubble[i].first) {
      |                    ^~~~~~~~~~~~~
a.cc:48:46: error: 'arr_bubble' was not declared in this scope
   48 |                 if(arr_selection[i].first != arr_bubble[i].first) {
      |                                              ^~~~~~~~~~
a.cc:57:33: error: 'arr_selection' was not declared in this scope
   57 |                         cout << arr_selection[i].first << arr_selection[i].second;
      |                                 ^~~~~~~~~~~~~
a.cc:60:40: error: 'arr_selection' was not declared in this scope
   60 |                         cout << " " << arr_selection[i].first << arr_selection[i].second;
      |                                        ^~~~~~~~~~~~~
a.cc:72:27: error: a function-definition is not allowed here before '{' token
   72 |         void bubble_sort(){
      |                           ^
a.cc:85:30: error: a function-definition is not allowed here before '{' token
   85 |         void selection_sort(){
      |                              ^