Language: C++

/***
*	??????????????????
*	???????¨??????????????????§?????????????°????minj???????????????????????????????????????????????´???????????¢?????´????????????
****/

#include <iostream>
#include <vector>
using namespace std;


int main(void)		//???????????¢??°
{
	int n;
	cin >> n;
	
	vector <int> str;
	str.resize(n);
	
	for(int i =0; i < n ;  i++){	//????????\???
		cin >> str[i] ;
	}

//-----------------------------------??\????????????????????????
	for( int i=0 ; i < n-1 ; ++i ){
		
		for(int j = 1 ; j< (n-i); j++){
			if( str[j] < str[j-1]){//????????????????´???¨??????
				int temp = str[j];
				str[j]     = str[j-1];
				str[j-1]   = temp;
				cnter ++;
			}
		}
	}
//----------------------------------	???????????????
	for(int i =0; i<n ; i++){
		cout << str[i] ;
		if(i != (n-1)){
			cout << " ";
		}
	}
	cout << endl;
	
//	if(isStable(in, out )) {
		cout << "Stable" << endl;
//	}else if(){
//		cout << "Not stable" << endl;
	}
//-------------------------------------------------???????????????	
	for( int i=0 ; i <= ( n-1 ) ; i++ ){
		int minj = i;
		int p = 0;
		for(int j = i ; j<= ( n-1 ); j++ ){
			
			if( str[j] < str[minj]){	//???????????????????????§????°??????????????´?minj????±???????
				minj = j;
				p++;
			}
		}
		if(p!=0){//???????????????????????´???
			int temp   = str[i];		//str[j]??¨str[minj]?????????????´??????????
			str[i]     = str[minj];
			str[minj]  = temp;
			cnter ++;
		}else{
			//???????????????????????´???
		}
	}
//----------------------------------	???????????????
	for(int i =0; i<n ; i++){
		cout << str[i] ;
		if(i != (n-1)){
			cout << " ";
		}
	}
	cout << endl;
	
	if(isStable) {
		cout << "Stable" << endl;
	}else if(){
		cout << "Not stable" << endl;
	}	
	return 0;
}

//----------------------------------------isStable ??¢??°
isStabel(int in, int out, int n){
	for (int i = 0 ; i < (n-1); i++){
		for (int j = (i+1) ; j < (n-1); j++){
			for (int a = 0 ; a < (n-1) ; a++){
				for( int b = (a+1) ; b < ( n-1); b++){
					if(in[i] == in[j] && in[i] == out[b]){
						if(in[i] == in[j] && in[j] == out[a]){
							return false;
						}
					}
				}
			}
		}
	}
	return true;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:33: error: 'cnter' was not declared in this scope
   31 |                                 cnter ++;
      |                                 ^~~~~
a.cc: At global scope:
a.cc:50:9: error: expected unqualified-id before 'for'
   50 |         for( int i=0 ; i <= ( n-1 ) ; i++ ){
      |         ^~~
a.cc:50:24: error: 'i' does not name a type
   50 |         for( int i=0 ; i <= ( n-1 ) ; i++ ){
      |                        ^
a.cc:50:39: error: 'i' does not name a type
   50 |         for( int i=0 ; i <= ( n-1 ) ; i++ ){
      |                                       ^
a.cc:70:9: error: expected unqualified-id before 'for'
   70 |         for(int i =0; i<n ; i++){
      |         ^~~
a.cc:70:23: error: 'i' does not name a type
   70 |         for(int i =0; i<n ; i++){
      |                       ^
a.cc:70:29: error: 'i' does not name a type
   70 |         for(int i =0; i<n ; i++){
      |                             ^
a.cc:76:9: error: 'cout' does not name a type
   76 |         cout << endl;
      |         ^~~~
a.cc:78:9: error: expected unqualified-id before 'if'
   78 |         if(isStable) {
      |         ^~
a.cc:80:10: error: expected unqualified-id before 'else'
   80 |         }else if(){
      |          ^~~~
a.cc:83:9: error: expected unqualified-id before 'return'
   83 |         return 0;
      |         ^~~~~~
a.cc:84:1: error: expected declaration before '}' token
   84 | }
      | ^
a.cc:87:1: error: ISO C++ forbids declaration of 'isStabel' with no type [-fpermissive]
   87 | isStabel(int in, int out, int n){
      | ^~~~~~~~
a.cc: In function 'int isStabel(int, int, int)':
a.cc:92:46: error: invalid types 'int[int]' for array subscript
   92 |                                         if(in[i] == in[j] && in[i] == out[b]){
      |                                              ^
a.cc:92:55: error: invalid types 'int[int]' for array subscript
   92 |                                         if(in[i] == in[j] && in[i] == out[b]){
      |                                                       ^
a.cc:92:64: error: invalid types 'int[int]' for array subscript
   92 |                                         if(in[i] == in[j] && in[i] == out[b]){
      |                                                                ^
a.cc:92:74: error: invalid types 'int[int]' for array subscript
   92 |                                         if(in[i] == in[j] && in[i] == out[b]){
      |                                                                          ^
a.cc:93:54: error: invalid types 'int[int]' for array subscript
   93 |                                                 if(in[i] == in[j] && in[j] == out[a]){
      |                                                      ^
a.cc:93:63: error: invalid types 'int[int]' for array subscript
   93 |                                                 if(in[i] == in[j] && in[j] == out[a]){
      |                                                               ^
a.cc:93:72: error: invalid types 'int[int]' for array subscript
   93 |                                                 if(in[i] == in[j] && in[j] == out[a]){
      |                                                                        ^
a.cc:93:82: error: invalid types 'int[int]' for array subscript
   93 |                                                 if(in[i] == in[j] && in[j] == out[a]){
      |                                                                                  ^