Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

void print_vector(vector<int> v)
{
    int n = v.size();
    for (int i = 0; i < n; i++){
        if (i) cout << ' ';
        cout << v[i];
    }
}

void buble_Sort(vector<int> v, int n)
{
    bool flag = true;
    //int count_exchange = 0;
    bool notStable = false;
    while (flag)
    {
        flag = false;
        for (int j = n - 1; j >= 1; j--)
        {
            if (v[j] < v[j - 1])
            {
                //count_exchange++;
                if(v[j] == v[j - 1]) notStable = true;

                int temp = v[j];
                v[j] = v[j - 1];
                v[j - 1] = temp;
                flag = true;
            }
        }
    }

    print_vector(v);
    cout << is_Stable(notStable) << endl;
}

void seliction_Sort(vector<int> v, int n)
{
    int mini;//, count = 0;
    bool notStable = false;
    for (int i = 0; i < n - 1; i++)
    {
        mini = i;
        for (int j = i + 1; j < n; j++){
            if (v[j] < v[mini])
                mini = j;
        }

        if (i != mini){
            //count++;
            if(v[i], v[mini]) notStable = true;
            swap(v[i], v[mini]);
        }
    }

    print_vector(v);
    cout << endl << is_Stable(notStable) << endl;
}

string is_Stable(bool notStable){
    if(notStable)return "Not Stable";
    else return "Stable";
}

signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<int> v;

    for (int temp; cin >> temp;){v.push_back(temp);}

    buble_Sort(v, n);
    seliction_Sort(v, n);
}


Compiler output:
a.cc: In function 'void buble_Sort(std::vector<int>, int)':
a.cc:58:13: error: 'is_Stable' was not declared in this scope; did you mean 'notStable'?
   58 |     cout << is_Stable(notStable) << endl;
      |             ^~~~~~~~~
      |             notStable
a.cc: In function 'void seliction_Sort(std::vector<int>, int)':
a.cc:75:19: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   75 |             if(v[i], v[mini]) notStable = true;
      |                   ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:81:21: error: 'is_Stable' was not declared in this scope; did you mean 'notStable'?
   81 |     cout << endl << is_Stable(notStable) << endl;
      |                     ^~~~~~~~~
      |                     notStable