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);

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

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

void buble_Sort(vector<string> 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;

                string 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<string> 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;
}

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

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

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

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


Compiler output:
a.cc: In function 'void seliction_Sort(std::vector<std::__cxx11::basic_string<char> >, int)':
a.cc:80:19: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   80 |             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:80:20: error: could not convert '(((void)v.std::vector<std::__cxx11::basic_string<char> >::operator[](((std::vector<std::__cxx11::basic_string<char> >::size_type)i))), v.std::vector<std::__cxx11::basic_string<char> >::operator[](((std::vector<std::__cxx11::basic_string<char> >::size_type)mini)))' from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   80 |             if(v[i], v[mini]) notStable = true;