Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
   
int main(){
	int n;
	int mini;
	cin >> n;
  	int A[n];
    int B[n];
	char a[n],b[n];
	bool stable;
 	for(int i=0;i<n;i++){
   		cin>>a[i]>>A[i];
    	b[i]=a[i];
    	B[i]=A[i];
  	}
  
  	for(int i=0;i<n-1;i++){
    	for(int j=n-1;j>i;j--){
      		if(A[j]<A[j-1]){
    			swap(a[j],a[j-1]);
    			swap(A[j],A[j-1]);
      		}
    	}
  	}
  
  	for(int i=0;i<n-1;i++){
    	mini=i;
    	for(int j=i+1;j<n;j++){
      		if(B[j]<B[mini]) mini=j;
    	}
    	swap(b[i],b[mini]);   
    	swap(B[i],B[mini]);
  	}
  
  	for(int i=0;i<n;i++){
    	if(i)cout<<' ';
    	cout<<a[i]<<A[i];
  	}
  	cout<<endl<<"Stable"<<endl;
  	for(int i=0;i<n;i++){
    	if(i)cout<<' ';
    		cout<<b[i]<<B[i];
  	}
	cout << endl;
	
	for(int i=0;i<n;i++){
    	if(a[i]==b[i] && A[i]==B[i]) stable = true;
    	else stable = false;
  	}
	if(!stable) cout << "Stable" << endl;
	else cout << "Not stable" << endl;
  	return 0;
}


Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |    
      | ^
a.cc:4:1: error: extended character   is not valid in an identifier
a.cc:4:1: error: extended character   is not valid in an identifier
a.cc:9:1: error: extended character   is not valid in an identifier
    9 |         int A[n];
      | ^
a.cc:9:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |         for(int i=0;i<n;i++){
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
   14 |                 cin>>a[i]>>A[i];
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |         b[i]=a[i];
      | ^
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
   16 |         B[i]=A[i];
      | ^
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
   17 |         }
      | ^
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
   18 |   
      | ^
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
   19 |         for(int i=0;i<n-1;i++){
      | ^
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |         for(int j=n-1;j>i;j--){
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
   21 |                 if(A[j]<A[j-1]){
      | ^
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
   22 |                         swap(a[j],a[j-1]);
      | ^
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:23:1: error: extended character   is not valid in an identifier
   23 |                         swap(A[j],A[j-1]);
      | ^
a.cc:23:1: error: extended character   is not valid in an identifier
a.cc:23:1: error: extended character   is not valid in an identifier
a.cc:23:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
   24 |                 }
      | ^
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
   25 |         }
      | ^
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
   26 |         }
      | ^
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
   27 |   
      | ^
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
   28 |         for(int i=0;i<n-1;i++){
      | ^
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
   29 |         mini=i;
      | ^
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
   30 |         for(int j=i+1;j<n;j++){
      | ^
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
   31 |                 if(B[j]<B[mini]) mini=j;
      | ^
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
   32 |         }
      | ^
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
   33 |         swap(b[i],b[mini]);  
      | ^
a.cc:33:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
a.cc:33:28: error: extended character   is not valid in an identifier
   33 |         swap(b[i],b[mini]);  
      |                            ^
a.cc:33:28: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
   34 |         swap(B[i],B[mini]);
      | ^
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:35:1: error: extended character   is not valid in an identifier
   35 |         }
      | ^
a.cc:35:1: error: extended character   is not valid in an identifier
a.cc:36:1: error: extended character   is not valid in an identifier
   36 |   
      | ^
a.cc:36:1: error: extended character   is not valid in an identifier
a.cc:37:1: error: extended character   is not valid in an identifier
   37 |         for(int i=0;i<n;i++){
      | ^
a.cc:37:1: error: extended character   is not valid in an identifier
a.cc:38:1: error: extended character   is not valid in an identifier
   38 |         if(i)cout<<' ';
      | ^
a.cc:38:1: error: extended character   is not valid in an identifier
a.cc:38:1: error: extended character   is not valid in an identifier
a.cc:38:1: error: extended character   is not valid in an identifier
a.cc:39:1: error: extended character   is not valid in an identifier
   39 |         cout<<a[i]<<A[i];
      | ^
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
   40 |         }
      | ^
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
   41 |         cout<<endl<<"Stable"<<endl;
      | ^
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
   42 |         for(int i=0;i<n;i++){
      | ^
a.cc:42:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
   43 |         if(i)cout<<' ';
      | ^
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
   44 |                 cout<<b[i]<<B[i];
      | ^
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
   45 |         }
      | ^
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
   49 |         if(a[i]==b[i] && A[i]==B[i]) stable = true;
      | ^
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:50:1: error: extended character   is not valid in an identifier
   50 |         else stable = false;
      | ^
a.cc:50:1: error: extended character   is not valid in an identifier
a.cc:50:1: error: extended character