criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<stdio.h>
using namespace std;

struct Card{char suit,value;};

void bubble(struct Card A[],int N){
  for(int i=0;i<N;i++){
    for(int j=N-1;j>=i;j--){
      if(A[j].value<A[j-1].value){
	Card t=A[j];A[j]=A[j-1];A[j-1]=t;
      }
    }
  }
}

void selection(struct Card A[],int N){
  for(int i=0;i<N;i++){
    int minj=i;
    for(int j=i;j<N;j++){
      if(A[j].value<A[minj].value) minj=j;
    }
    Card t=A[i];A[i]=A[minj];A[minj]=t;
  }
}

void print(struct Card A[],int N){
  for(int i=0;i<N;i++){
    if(i>0) cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

bool isStable(struct Card C1[],struct Card C2[],int N){
  for(int i=0;i<N;i++){
    if(C1[i].suit != C2[i].suit) return false;
  }
  return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i=0;i<N;i++){
    cin >> C1[i].suit >> C1[i].value;
  }

  for(int i=0;i<N;i++) C2[i]=C1[i];

  bubble(C1,N);
  selection(C2,N);

  print(C1,N);
  cout << "Stable" << endl;
  print(C2,N);
  if(isStable(C1,C2,N)){
    cout << "Stable" << endl;
  }else{
    cout << "Not Stable" << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'void print(Card*, int)':
a.cc:28:13: error: 'cout' was not declared in this scope
   28 |     if(i>0) cout << " ";
      |             ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout << A[i].suit << A[i].value;
      |     ^~~~
a.cc:29:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:3: error: 'cout' was not declared in this scope
   31 |   cout << endl;
      |   ^~~~
a.cc:31:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:11: error: 'endl' was not declared in this scope
   31 |   cout << endl;
      |           ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc: In function 'int main()':
a.cc:46:3: error: 'cin' was not declared in this scope
   46 |   cin >> N;
      |   ^~~
a.cc:46:3: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:57:3: error: 'cout' was not declared in this scope
   57 |   cout << "Stable" << endl;
      |   ^~~~
a.cc:57:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:57:23: error: 'endl' was not declared in this scope
   57 |   cout << "Stable" << endl;
      |                       ^~~~
a.cc:57:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
#include <string>
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

using namespace std;

void bubble(int si[],char sc[],int N)
{
  for(int i=0;i<N;i++)
  {
    for(int j=N-1;j>i;j--)
    {
      if(si[j]<si[j-1])
      {
        swap(si[j],si[j-1]);
        swap(sc[j],sc[j-1]);
      }
    }
  }
}

void selection(int si[],char sc[],int N)
{
  for(int i=0;i<N;i++)
  {
    int mini = i;
    for(int j=i;j<N;j++)
    {
      if(si[j]<si[mini]) mini=j;
    }
    swap(si[i],si[mini]);
    swap(sc[i],sc[mini]);
  }
}

int main()
{
  int N; cin>>N;
  char sc_1[N],sc_2[N];
  int si_1[N],si_2[N];
  REP(i,N) cin>>sc_1[i]>>si_1[i];;

  memcpy(sc_2,sc_1,sizeof(char)*N);
  memcpy(si_2,si_1,sizeof(int)*N);

  bubble(si_1,sc_1,N);
  selection(si_2,sc_2,N);
  REP(i,N)
  {
    if(i) cout<<' ';
    cout<<sc_1[i]<<si_1[i];
  }
  cout<<endl;
  cout<<"Stable"<<endl;

  REP(i,N)
  {
    if(i) cout<<' ';
    cout<<sc_2[i]<<si_2[i];
  }
  cout<<endl;

  bool stable=true;
  REP(i,N) if(sc_2[i]!=sc_1[i]) stable = false;
  if(stable){
    cout<<"Stable"<<endl;
  }else{
    cout<<"Not Stable"<<endl;
  }




}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:3: error: 'memcpy' was not declared in this scope
   43 |   memcpy(sc_2,sc_1,sizeof(char)*N);
      |   ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;
 
struct Card { char suit; int value; };
 
void Bubblesort(struct Card A[], int N) {
    bool flag = 1;
    for (int i = 0; flag; i++) {
        flag = 0;
        for (int j = N - 1; j > i; j--) {
            if (A[j].value < A[j - 1].value) {
                swap(A[j], A[j - 1]);
                flag = 1;
            }
        }
    }
}
 
void Selectionsort(struct Card A[], int N) {
    for (int i = 0; i < N; i++) {
        int minj = i;
        for (int j = i+1; N>j; j++) {
            if (A[minj].value > A[j].value) {
                minj = j;
            }
        }
        if (i != minj) {
            swap(A[i], A[minj]);
        }
    }
}
void print(struct Card A[], int N) {
    for (int i = 0; i < N; i++) {
        if (i) {
            cout << " ";
        }
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

int isStable(C1[],C2[],N){
    for (int i=0;i<N;i++){
        if(C1[i]!=C2[i]){
            return false;
            break;
        }
    }
    return true;
}




int main() {
    int N;
    Card C1[100], C2[100];
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> C1[i].suit >> C1[i].value;
    }
    for (int i = 0; i < N; i++) {
        C2[i] = C1[i];
    }
 
    Bubblesort(C1, N);
    Selectionsort(C2, N);
 
    print(C1, N);
    cout << "Stable" << endl;
 
    print(C2, N);
    if (isStable(C1,C2,N)) {
        cout << "Stable" << endl;
    }
    else {
        cout << "Not stable" << endl;
    }
    return 0;
}

Compiler output:
a.cc:45:14: error: 'C1' was not declared in this scope
   45 | int isStable(C1[],C2[],N){
      |              ^~
a.cc:45:17: error: expected primary-expression before ']' token
   45 | int isStable(C1[],C2[],N){
      |                 ^
a.cc:45:19: error: 'C2' was not declared in this scope
   45 | int isStable(C1[],C2[],N){
      |                   ^~
a.cc:45:22: error: expected primary-expression before ']' token
   45 | int isStable(C1[],C2[],N){
      |                      ^
a.cc:45:24: error: 'N' was not declared in this scope
   45 | int isStable(C1[],C2[],N){
      |                        ^
a.cc:45:25: error: expression list treated as compound expression in initializer [-fpermissive]
   45 | int isStable(C1[],C2[],N){
      |                         ^
a.cc: In function 'int main()':
a.cc:76:17: error: 'isStable' cannot be used as a function
   76 |     if (isStable(C1,C2,N)) {
      |         ~~~~~~~~^~~~~~~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <utility>
using namespace std;

typedef struct {
	char mark;
	int num;
} TRUMP;

void bubbleSort(TRUMP a[], int n);
void selectionSort(TRUMP a[], int n);
void dispTrumpList(const TRUMP trump[], int n);
bool isStable(const TRUMP t1[], const TRUMP t2[], int n);

int main(void)
{	
	int n;
	cin >> n;
	
	TRUMP trump[36], trump1[36], trump2[36];
	for (int i = 0; i < n; i++) {
		cin >> trump[i].mark >> trump[i].num;
	}
	memcpy(trump1, trump, sizeof(trump) * n);
	memcpy(trump2, trump, sizeof(trump) * n);
	
	bubbleSort(trump1, n);
	dispTrumpList(trump1, n);
	if (isStable(trump, trump1, n)) cout << "Stable" << endl;
	else cout << "Not stable" << endl;
	
	selectionSort(trump2, n);
	dispTrumpList(trump2, n);
	if (isStable(trump, trump2, n)) cout << "Stable" << endl;
	else cout << "Not stable" << endl;
	
	return 0;
}

void bubbleSort(TRUMP a[], int n)
{
	for (int i = 0; i < n; i++) {
		for (int j = n - 1; j > i; j--) {
			if (a[j].num < a[j-1].num) {
				swap(a[j], a[j-1]);
			}
		}
	}
}

void selectionSort(TRUMP a[], int n)
{
	int i, j;
	for (i = 0; i < n; i++) {
		int minj = i;
		for (j = i; j < n; j++) {
			if (a[j].num < a[minj].num) {
				minj = j;
			}
		}
		swap(a[i], a[minj]);
	}
}

void dispTrumpList(const TRUMP trump[], int n)
{
	for (int i = 0; i < n; i++) {
		cout << trump[i].mark << trump[i].num;
		if (i < n - 1) cout << " ";
		else cout << endl;
	}
}

bool isStable(const TRUMP t1[], const TRUMP t2[], int n)
{
	char m1[9][4] = {"\0"};
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 4; j++) {
			if (m1[t1[i].num-1][j] == '\0') {
				m1[t1[i].num-1][j] = t1.mark;
				break;
			}
		}
	}
	
	char m2[9][4] = {"\0"};
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 4; j++) {
			if (m2[t2[i].num-1][j] == '\0') {
				m2[t2[i].num-1][j] = t2.mark;
				break;
			}
		}
	}
	
	for (int i = 0; i < 9; i++) {
		for (int j = 0; j < 4; j++) {
			if (m1[i][j] != m2[i][j]) return false;
		}
	}
	return true;
}

Compiler output:
a.cc: In function 'bool isStable(const TRUMP*, const TRUMP*, int)':
a.cc:82:57: error: request for member 'mark' in 't1', which is of pointer type 'const TRUMP*' (maybe you meant to use '->' ?)
   82 |                                 m1[t1[i].num-1][j] = t1.mark;
      |                                                         ^~~~
a.cc:92:57: error: request for member 'mark' in 't2', which is of pointer type 'const TRUMP*' (maybe you meant to use '->' ?)
   92 |                                 m2[t2[i].num-1][j] = t2.mark;
      |                                                         ^~~~
Language: C++

#include<iostream>
using namespace std;
 struct card{char suit,value;};

void bubble(struct card A[],int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i;j--){
if(A[j].value<A[j-1].value){
card t=A[j];
A[j]=A[j-1];
A[j-1]=t;
}
}
}
}

void select(struct card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value<A[minj].value)minj=j;
}
card t=A[i];
A[i]=A[minj];
A[minj]=t;
}
}

voir print(struct card A[],int N){
for(int i=0;i<N;i++){
if(i>0)cout<<" ";
cout<<A[i].suit<<A[i].value;
}
cout<<endl;
}

bool stable(struct card c1[],struct card c2[],int N){
for(int i=0;i<N;i++){
if(c1[i].suit !=c2[i].suit)return false;
}
return true;
}

int main(){
card ca[100],c2[100];
int N;
char ch;

cin>>N;
for(int i=0;i<N;i++){
cin>>c1[i].suit>>c1[i].value;
}

for(int i=0;i<N;i++)c2[i]=c1[i];

bubble(c1,N);
select(c2,N);

printf(c1,N);
cout<<"Stable"<<endl;
print(c2,N);
if(Stable(c1,c2,N)){
cout<<"Stable"<<endl;
}else{cout<<"Not stable"<<endl;
}

return 0;
}

Compiler output:
a.cc:29:1: error: 'voir' does not name a type; did you mean 'void'?
   29 | voir print(struct card A[],int N){
      | ^~~~
      | void
a.cc: In function 'int main()':
a.cc:51:6: error: 'c1' was not declared in this scope; did you mean 'ch'?
   51 | cin>>c1[i].suit>>c1[i].value;
      |      ^~
      |      ch
a.cc:54:27: error: 'c1' was not declared in this scope; did you mean 'ch'?
   54 | for(int i=0;i<N;i++)c2[i]=c1[i];
      |                           ^~
      |                           ch
a.cc:56:8: error: 'c1' was not declared in this scope; did you mean 'ch'?
   56 | bubble(c1,N);
      |        ^~
      |        ch
a.cc:61:1: error: 'print' was not declared in this scope; did you mean 'printf'?
   61 | print(c2,N);
      | ^~~~~
      | printf
a.cc:62:4: error: 'Stable' was not declared in this scope; did you mean 'stable'?
   62 | if(Stable(c1,c2,N)){
      |    ^~~~~~
      |    stable
Language: C++

#include<iostream>
using namespace std;
 struct card{char suit,value;};

void bubble(struct card A[],int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i;j--){
if(A[j].value<A[j-1].value){
card t=A[j];
A[j]=A[j-1];
A[j-1]=t;
}
}
}
}

void select(struct card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value<A[minj].value)minj=j;
}
card t=A[i];
A[i]=A[minj];
A[minj]=t;
}
}

void print(struct card A[],int N){
for(int i=0;i<N;i++){
if(i>0)cout<<" ";
cout<<A[i].suit<<A[i].value;
}
cout<<endl;
}

bool stable(struct card c1[],struct card c2[],int N){
for(int i=0;i<N;i++){
if(c1[i].suit !=c2[i].suit)return false;
}
return true;
}

int main(){
card ca[100],c2[100];
int N;
char ch;

cin>>N;
for(int i=0;i<N;i++){
cin>>c1[i].suit>>c1[i].value;
}

for(int i=0;i<N;i++)c2[i]=c1[i];

bubble(c1,N);
select(c2,N);

printf(c1,N);
cout<<"Stable"<<endl;
print(c2,N);
if(Stable(c1,c2,N)){
cout<<"Stable"<<endl;
}else{cout<<"Not stable"<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:6: error: 'c1' was not declared in this scope; did you mean 'ch'?
   51 | cin>>c1[i].suit>>c1[i].value;
      |      ^~
      |      ch
a.cc:54:27: error: 'c1' was not declared in this scope; did you mean 'ch'?
   54 | for(int i=0;i<N;i++)c2[i]=c1[i];
      |                           ^~
      |                           ch
a.cc:56:8: error: 'c1' was not declared in this scope; did you mean 'ch'?
   56 | bubble(c1,N);
      |        ^~
      |        ch
a.cc:62:4: error: 'Stable' was not declared in this scope; did you mean 'stable'?
   62 | if(Stable(c1,c2,N)){
      |    ^~~~~~
      |    stable
Language: C++

#include<iostream>
using namespace std;
 struct card{char suit,value;};

void bubble(struct card A[],int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i;j--){
if(A[j].value<A[j-1].value){
card t=A[j];
A[j]=A[j-1];
A[j-1]=t;
}
}
}
}

void select(struct card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value<A[minj].value)minj=j;
}
card t=A[i];
A[i]=A[minj];
A[minj]=t;
}
}

void print(struct card A[],int N){
for(int i=0;i<N;i++){
if(i>0)cout<<" ";
cout<<A[i].suit<<A[i].value;
}
cout<<endl;
}

bool stable(struct card c1[],struct card c2[],int N){
for(int i=0;i<N;i++){
if(c1[i].suit !=c2[i].suit)return false;
}
return true;
}

int main(){
card ca[100],c2[100];
int N;
char ch;

cin>>N;
for(int i=0;i<N;i++){
cin>>c1[i].suit>>c1[i].value;
}

for(int i=0;i<N;i++)c2[i]=c1[i];

bubble(c1,N);
select(c2,N);

printf(c1,N);
cout<<"Stable"<<endl;
print(c2,N);
if(stable(c1,c2,N)){
cout<<"Stable"<<endl;
}else{cout<<"Not stable"<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:6: error: 'c1' was not declared in this scope; did you mean 'ch'?
   51 | cin>>c1[i].suit>>c1[i].value;
      |      ^~
      |      ch
a.cc:54:27: error: 'c1' was not declared in this scope; did you mean 'ch'?
   54 | for(int i=0;i<N;i++)c2[i]=c1[i];
      |                           ^~
      |                           ch
a.cc:56:8: error: 'c1' was not declared in this scope; did you mean 'ch'?
   56 | bubble(c1,N);
      |        ^~
      |        ch
Language: C++

#include<iostream>
using namespace std;
 struct card{char suit,value;};

void bubble(struct card A[],int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i;j--){
if(A[j].value<A[j-1].value){
card t=A[j];
A[j]=A[j-1];
A[j-1]=t;
}
}
}
}

void select(struct card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value<A[minj].value)minj=j;
}
card t=A[i];
A[i]=A[minj];
A[minj]=t;
}
}

void print(struct card A[],int N){
for(int i=0;i<N;i++){
if(i>0)cout<<" ";
cout<<A[i].suit<<A[i].value;
}
cout<<endl;
}

bool stable(struct card c1[],struct card c2[],int N){
for(int i=0;i<N;i++){
if(c1[i].suit !=c2[i].suit)return false;
}
return true;
}

int main(){
card ca[100],c2[100];
int N;
char ch;

cin>>N;
for(int i=0;i<N;i++){
cin>>c1[i].suit>>c1[i].value;
}

for(int i=0;i<N;i++)c2[i]=c1[i];

bubble(c1,N);
select(c2,N);

print(c1,N);
cout<<"Stable"<<endl;
print(c2,N);
if(stable(c1,c2,N)){
cout<<"Stable"<<endl;
}else{cout<<"Not stable"<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:6: error: 'c1' was not declared in this scope; did you mean 'ch'?
   51 | cin>>c1[i].suit>>c1[i].value;
      |      ^~
      |      ch
a.cc:54:27: error: 'c1' was not declared in this scope; did you mean 'ch'?
   54 | for(int i=0;i<N;i++)c2[i]=c1[i];
      |                           ^~
      |                           ch
a.cc:56:8: error: 'c1' was not declared in this scope; did you mean 'ch'?
   56 | bubble(c1,N);
      |        ^~
      |        ch
Language: C++

#include<iostream>
using namespace std;

struct Card{char suit,value};

void bubble(struct Card A[], int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i+1;j--){
if(A[j].value<A[j-1].value){
Card t=A[j];A[j]=A[j-1];A[j-1]=t;
}
}
}
}
void selectionSort(struct Card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value<A[minj].value)minj=j;
}
Card t=A[i];A[i]=A[minj];A[minj]=t;
}
}
void print(struct Card A[],int N){
for(int i=0;i<N;i++){
if(i>0) cout <<" ";
cout << A[i].suit <<A[i].value;
}
cout <<endl;
}

Compiler output:
a.cc:4:23: error: expected ';' at end of member declaration
    4 | struct Card{char suit,value};
      |                       ^~~~~
      |                            ;
Language: C++

#include<iostream>
using namespace std;

struct Card{char suit,value;};

void bubble(struct Card A[], int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i+1;j--){
if(A[j].value < A[j-1].value){
Card t=A[j] ; A[j]=A[j-1] ; A[j-1]=t;
}
}
}
}
void selectionSort(struct Card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value < A[minj].value) minj=j;
}
Card t=A[i] ; A[i]=A[minj] ; A[minj]=t;
}
}
void print(struct Card A[],int N){
for(int i=0;i<N;i++){
if(i>0) cout <<" ";
cout << A[i].suit <<A[i].value;
}
cout << endl;
}
bool isStable(struct Card C1[],struct Card C2,int N){
for(int i=0;i<N;i++){
if (C1[i].suit!=C2[i].suit) return false;
}
return true;
}
int main(){
Card C1[100],C2[100];
int N;
char ch;
cin >>N;
for(int i=0;i<N;i++){
cin >>C1[i].suit >>C1[i].value;
}
for(int i=0;i<N;i++) C2[i]=C1[i];
bubble(C1,N);
selection(C2,N);
print(C1,N);
cout <<"Stable" <<endl;
print(C2,N);
if (isStable(C1,C2,N)){
cout <<"Stable"<<endl;
}
else
{
cout <<"Not Stable" <<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'bool isStable(Card*, Card, int)':
a.cc:33:19: error: no match for 'operator[]' (operand types are 'Card' and 'int')
   33 | if (C1[i].suit!=C2[i].suit) return false;
      |                   ^
a.cc: In function 'int main()':
a.cc:47:1: error: 'selection' was not declared in this scope; did you mean 'select'?
   47 | selection(C2,N);
      | ^~~~~~~~~
      | select
a.cc:51:17: error: could not convert '(Card*)(& C2)' from 'Card*' to 'Card'
   51 | if (isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
Language: C++

#include<iostream>
using namespace std;

struct Card{char suit,value;};

void bubble(struct Card A[], int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i+1;j--){
if(A[j].value < A[j-1].value){
Card t=A[j] ; A[j]=A[j-1] ; A[j-1]=t;
}
}
}
}
void selectionSort(struct Card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value < A[minj].value) minj=j;
}
Card t=A[i] ; A[i]=A[minj] ; A[minj]=t;
}
}
void print(struct Card A[],int N){
for(int i=0;i<N;i++){
if(i>0) cout <<" ";
cout << A[i].suit <<A[i].value;
}
cout << endl;
}
bool isStable(struct Card C1[],struct Card C2,int N){
for(int i=0;i<N;i++){
if (C1[i].suit!=C2[i].suit) return false;
}
return true;
}
int main(){
Card C1[100],C2[100];
int N;
char ch;
cin >>N;
for(int i=0;i<N;i++){
cin >>C1[i].suit >>C1[i].value;
}
for(int i=0;i<N;i++) C2[i]=C1[i];
bubble(C1,N);
selectionSort(C2,N);
print(C1,N);
cout <<"Stable" <<endl;
print(C2,N);
if (isStable(C1,C2,N)){
cout <<"Stable"<<endl;
}
else
{
cout <<"Not Stable" <<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'bool isStable(Card*, Card, int)':
a.cc:33:19: error: no match for 'operator[]' (operand types are 'Card' and 'int')
   33 | if (C1[i].suit!=C2[i].suit) return false;
      |                   ^
a.cc: In function 'int main()':
a.cc:51:17: error: could not convert '(Card*)(& C2)' from 'Card*' to 'Card'
   51 | if (isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
Language: C++

#include<iostream>
using namespace std;

struct Card{char suit,value;};

void bubble(struct Card A[], int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i+1;j--){
if(A[j].value < A[j-1].value){
Card t=A[j] ; A[j]=A[j-1] ; A[j-1]=t;
}
}
}
}
void selectionSort(struct Card A[],int N){
for(int i=0;i<N;i++){
int minj=i;
for(int j=i;j<N;j++){
if(A[j].value < A[minj].value) minj=j;
}
Card t=A[i] ; A[i]=A[minj] ; A[minj]=t;
}
}
void print(struct Card A[],int N){
for(int i=0;i<N;i++){
if(i>0) cout <<" ";
cout << A[i].suit <<A[i].value;
}
cout << endl;
}
bool isStable(struct Card C1[],struct Card C2,int N){
for(int i=0;i<N;i++){
if (C1[i].suit!=C2[i].suit) return false;
}
return true;
}
int main(){
Card C1[100],C2[100];
int N;
char ch;
cin >>N;
for(int i=0;i<N;i++){
cin >>C1[i].suit >>C1[i].value;
}
for(int i=0;i<N;i++) C2[i]=C1[i];
bubble(C1,N);
selectionSort(C2,N);
print(C1,N);
cout <<"Stable" <<endl;
print(C2,N);
if (isStable(C1,C2,N)){
cout <<"Stable"<<endl;
}
else
{
cout <<"Not stable" <<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'bool isStable(Card*, Card, int)':
a.cc:33:19: error: no match for 'operator[]' (operand types are 'Card' and 'int')
   33 | if (C1[i].suit!=C2[i].suit) return false;
      |                   ^
a.cc: In function 'int main()':
a.cc:51:17: error: could not convert '(Card*)(& C2)' from 'Card*' to 'Card'
   51 | if (isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
Language: C++

def b_sort(ca)
  c = ca.dup
  s = 0
  c.sort_by{|i| [i[1], s += 1]}
end

def s_sort(ca)
  c = ca.dup
  c.size.times do |i|
    m = i
    i.upto(c.size - 1) do |j|
      if c[j][1] < c[m][1]
        m = j
      end
    end
    c[m], c[i] = c[i], c[m]
  end
  c
end

gets
a = gets.split.map do |e|
  e =~ /(\w)(\d+)/
  [$1, $2.to_i]
end
b, c = [b_sort(a), s_sort(a)].map do |d|
  d.map(&:join).join(' ')
end
puts b
puts 'Stable'
puts c
puts b == c ? 'Stable' : 'Not stable'

Compiler output:
a.cc:23:10: error: stray '\' in program
   23 |   e =~ /(\w)(\d+)/
      |          ^
a.cc:23:14: error: stray '\' in program
   23 |   e =~ /(\w)(\d+)/
      |              ^
a.cc:30:6: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   30 | puts 'Stable'
      |      ^~~~~~~~
a.cc:32:15: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   32 | puts b == c ? 'Stable' : 'Not stable'
      |               ^~~~~~~~
a.cc:32:26: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   32 | puts b == c ? 'Stable' : 'Not stable'
      |                          ^~~~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def b_sort(ca)
      | ^~~
a.cc:5:1: error: 'end' does not name a type
    5 | end
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

struct Card {char suit, value;};

void bubble(struct Card A[], int N){
    for(int i=0; i<N;i++){
        for(int j=N-1;j>=i;j--){
            if(A[j].value<A[j-1].vallue){
                Card t=A[j];
                A[j]=A[j-1];
                A[j-1]=t;
            }
        }
    }
}

void selection(struct Card A[], int N){
    for(int i=0;i<N;i++){
        int minj=i;
        for(int j=i;j<N;j++){
            if(A[j].value<A[minj].value) minj=j;
        }
        Card t=A[i];
        A[i]=A[minj];
        A[minj]=t;
    }
}

void print(struct Card A[], int N){
    for(int i=0;i<N;i++){
        cout<<A[i].suit<<A[i].value;
    }
    coout<<endl;
}

bool isStable(struct CardC1[], struct Card2[], int N){
    for(int i=0; i<N; i++){
        if(C1[i].suit!=C2[i].suit) return false;
    }
    return true;
}

int main(){
    Card C1[100],C2[100];
    int N;
    char ch;

    cin >> N;
    for(int i=0; i<N; i++){
        cin >> C1[i].suit>>C1[i].value;
    }

    for(int i=0; i<N; i++) C2[i]=C1[i];

    bubble(C1,N);
    selection(C2,N);
    print(C1,N);
    cout<<"Stable"<<endl;
    print(C2,N);
    if(isStable(C1,C2,N)){
        cout<<"Stable"<<endl;
    }else{
        cout<<"Not stable"<<endl;
    }
    endl;
}

Compiler output:
a.cc: In function 'void bubble(Card*, int)':
a.cc:9:34: error: 'struct Card' has no member named 'vallue'; did you mean 'value'?
    9 |             if(A[j].value<A[j-1].vallue){
      |                                  ^~~~~~
      |                                  value
a.cc: In function 'void print(Card*, int)':
a.cc:34:5: error: 'coout' was not declared in this scope
   34 |     coout<<endl;
      |     ^~~~~
a.cc: In function 'bool isStable(CardC1*, Card2*, int)':
a.cc:39:12: error: 'C1' was not declared in this scope; did you mean 'y1'?
   39 |         if(C1[i].suit!=C2[i].suit) return false;
      |            ^~
      |            y1
a.cc:39:24: error: 'C2' was not declared in this scope
   39 |         if(C1[i].suit!=C2[i].suit) return false;
      |                        ^~
a.cc: In function 'int main()':
a.cc:61:17: error: cannot convert 'Card*' to 'CardC1*'
   61 |     if(isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
a.cc:37:15: note:   initializing argument 1 of 'bool isStable(CardC1*, Card2*, int)'
   37 | bool isStable(struct CardC1[], struct Card2[], int N){
      |               ^~~~~~~~~~~~~~~
a.cc:66:9: error: statement cannot resolve address of overloaded function
   66 |     endl;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

struct Card {char suit, value;};

void bubble(struct Card A[], int N){
    for(int i=0; i<N;i++){
        for(int j=N-1;j>=i;j--){
            if(A[j].value<A[j-1].vallue){
                Card t=A[j];
                A[j]=A[j-1];
                A[j-1]=t;
            }
        }
    }
}

void selection(struct Card A[], int N){
    for(int i=0;i<N;i++){
        int minj=i;
        for(int j=i;j<N;j++){
            if(A[j].value<A[minj].value) minj=j;
        }
        Card t=A[i];
        A[i]=A[minj];
        A[minj]=t;
    }
}

void print(struct Card A[], int N){
    for(int i=0;i<N;i++){
        cout<<A[i].suit<<A[i].value;
    }
    coout<<endl;
}

bool isStable(struct CardC1[], struct Card2[], int N){
    for(int i=0; i<N; i++){
        if(C1[i].suit!=C2[i].suit) return false;
    }
    return true;
}

int main(){
    Card C1[100],C2[100];
    int N;
    char ch;

    cin >> N;
    for(int i=0; i<N; i++){
        cin >> C1[i].suit>>C1[i].value;
    }

    for(int i=0; i<N; i++) C2[i]=C1[i];

    bubble(C1,N);
    selection(C2,N);
    print(C1,N);
    cout<<"Stable"<<endl;
    print(C2,N);
    if(isStable(C1,C2,N)){
        cout<<"Stable"<<endl;
    }else{
        cout<<"Not stable"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void bubble(Card*, int)':
a.cc:9:34: error: 'struct Card' has no member named 'vallue'; did you mean 'value'?
    9 |             if(A[j].value<A[j-1].vallue){
      |                                  ^~~~~~
      |                                  value
a.cc: In function 'void print(Card*, int)':
a.cc:34:5: error: 'coout' was not declared in this scope
   34 |     coout<<endl;
      |     ^~~~~
a.cc: In function 'bool isStable(CardC1*, Card2*, int)':
a.cc:39:12: error: 'C1' was not declared in this scope; did you mean 'y1'?
   39 |         if(C1[i].suit!=C2[i].suit) return false;
      |            ^~
      |            y1
a.cc:39:24: error: 'C2' was not declared in this scope
   39 |         if(C1[i].suit!=C2[i].suit) return false;
      |                        ^~
a.cc: In function 'int main()':
a.cc:61:17: error: cannot convert 'Card*' to 'CardC1*'
   61 |     if(isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
a.cc:37:15: note:   initializing argument 1 of 'bool isStable(CardC1*, Card2*, int)'
   37 | bool isStable(struct CardC1[], struct Card2[], int N){
      |               ^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

struct Card {char suit, value;};

void bubble(struct Card A[], int N){
    for(int i=0; i<N;i++){
        for(int j=N-1;j>=i;j--){
            if(A[j].value<A[j-1].vallue){
                Card t=A[j];
                A[j]=A[j-1];
                A[j-1]=t;
            }
        }
    }
}

void selection(struct Card A[], int N){
    for(int i=0;i<N;i++){
        int minj=i;
        for(int j=i;j<N;j++){
            if(A[j].value<A[minj].value) minj=j;
        }
        Card t=A[i];
        A[i]=A[minj];
        A[minj]=t;
    }
}

void print(struct Card A[], int N){
    for(int i=0;i<N;i++){
        if(i>0) cout<<" ";
        cout<<A[i].suit<<A[i].value;
    }
    cout<<endl;
}

bool isStable(struct CardC1[], struct Card2[], int N){
    for(int i=0; i<N; i++){
        if(C1[i].suit!=C2[i].suit) return false;
    }
    return true;
}

int main(){
    Card C1[100],C2[100];
    int N;
    char ch;

    cin >> N;
    for(int i=0; i<N; i++){
        cin >> C1[i].suit>>C1[i].value;
    }

    for(int i=0; i<N; i++) C2[i]=C1[i];

    bubble(C1,N);
    selection(C2,N);
    print(C1,N);
    cout<<"Stable"<<endl;
    print(C2,N);
    if(isStable(C1,C2,N)){
        cout<<"Stable"<<endl;
    }else{
        cout<<"Not stable"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void bubble(Card*, int)':
a.cc:9:34: error: 'struct Card' has no member named 'vallue'; did you mean 'value'?
    9 |             if(A[j].value<A[j-1].vallue){
      |                                  ^~~~~~
      |                                  value
a.cc: In function 'bool isStable(CardC1*, Card2*, int)':
a.cc:40:12: error: 'C1' was not declared in this scope; did you mean 'y1'?
   40 |         if(C1[i].suit!=C2[i].suit) return false;
      |            ^~
      |            y1
a.cc:40:24: error: 'C2' was not declared in this scope
   40 |         if(C1[i].suit!=C2[i].suit) return false;
      |                        ^~
a.cc: In function 'int main()':
a.cc:62:17: error: cannot convert 'Card*' to 'CardC1*'
   62 |     if(isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
a.cc:38:15: note:   initializing argument 1 of 'bool isStable(CardC1*, Card2*, int)'
   38 | bool isStable(struct CardC1[], struct Card2[], int N){
      |               ^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

struct Card {char suit, value;};

void bubble(struct Card A[], int N){
    for(int i=0; i<N;i++){
        for(int j=N-1;j>=i;j--){
            if(A[j].value<A[j-1].value){
                Card t=A[j];
                A[j]=A[j-1];
                A[j-1]=t;
            }
        }
    }
}

void selection(struct Card A[], int N){
    for(int i=0;i<N;i++){
        int minj=i;
        for(int j=i;j<N;j++){
            if(A[j].value<A[minj].value) minj=j;
        }
        Card t=A[i];
        A[i]=A[minj];
        A[minj]=t;
    }
}

void print(struct Card A[], int N){
    for(int i=0;i<N;i++){
        if(i>0) cout<<" ";
        cout<<A[i].suit<<A[i].value;
    }
    cout<<endl;
}

bool isStable(struct CardC1[], struct Card2[], int N){
    for(int i=0; i<N; i++){
        if(C1[i].suit!=C2[i].suit) return false;
    }
    return true;
}

int main(){
    Card C1[100],C2[100];
    int N;
    char ch;

    cin >> N;
    for(int i=0; i<N; i++){
        cin >> C1[i].suit>>C1[i].value;
    }

    for(int i=0; i<N; i++) C2[i]=C1[i];

    bubble(C1,N);
    selection(C2,N);
    print(C1,N);
    cout<<"Stable"<<endl;
    print(C2,N);
    if(isStable(C1,C2,N)){
        cout<<"Stable"<<endl;
    }else{
        cout<<"Not stable"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'bool isStable(CardC1*, Card2*, int)':
a.cc:40:12: error: 'C1' was not declared in this scope; did you mean 'y1'?
   40 |         if(C1[i].suit!=C2[i].suit) return false;
      |            ^~
      |            y1
a.cc:40:24: error: 'C2' was not declared in this scope
   40 |         if(C1[i].suit!=C2[i].suit) return false;
      |                        ^~
a.cc: In function 'int main()':
a.cc:62:17: error: cannot convert 'Card*' to 'CardC1*'
   62 |     if(isStable(C1,C2,N)){
      |                 ^~
      |                 |
      |                 Card*
a.cc:38:15: note:   initializing argument 1 of 'bool isStable(CardC1*, Card2*, int)'
   38 | bool isStable(struct CardC1[], struct Card2[], int N){
      |               ^~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

bool selectionSort(char R[36][3], int N)
{
	bool isStable = true;
	for (int i = 1; i < N; i++)
	{
		char v[3];
		memcpy(v, &R[i][0], sizeof(v));
		
		int j = i - 1;
		while ((j >= 0) && (R[j][1] > v[1]))
		{
			memcpy(R[j + 1], R[j], sizeof(R[0]));
			j--;
		}
		memcpy(R[j + 1], v, sizeof(v));
		if (R[j + 2][1] == v[1])
		{
			isStable = false;
		}
	}
	return isStable;
}

bool bubbleSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < (N - 1); i++)
	{
		for (int j = N - 1; j > i; j--)
		{
			if (R[j - 1][1] > R[j][1])
			{
				char temp[3];
				memcpy(temp, R[j], sizeof(temp));
				memcpy(R[j], R[j - 1], sizeof(R[0]));
				memcpy(R[j - 1], temp, sizeof(R[0]));
			}
		}
	}
	return isStable;
}

void traceData(char R[36][3], int N, bool isStable)
{
	for (int i = 0; i < N - 1; i++)
	{
		cout << R[i] << " ";
	}
	cout << R[N - 1] << endl;
	if (isStable)
	{
		cout << "Stable" << endl;
	}
	else
	{
		cout << "Not Stable" << endl;
	}
}

int main()
{
	char CARD1[36][3];
	char CARD2[36][3];
	int N;
	bool isStable;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> CARD1[i];
	}
	memcpy(CARD2, CARD1, sizeof(CARD2));
	isStable = selectionSort(CARD1, N);
	traceData(CARD1, N, isStable);

	isStable = bubbleSort(CARD2, N);
	traceData(CARD2, N, isStable);

	return 0;
}

Compiler output:
a.cc: In function 'bool selectionSort(char (*)[3], int)':
a.cc:10:17: error: 'memcpy' was not declared in this scope
   10 |                 memcpy(v, &R[i][0], sizeof(v));
      |                 ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc: In function 'bool bubbleSort(char (*)[3], int)':
a.cc:38:33: error: 'memcpy' was not declared in this scope
   38 |                                 memcpy(temp, R[j], sizeof(temp));
      |                                 ^~~~~~
a.cc:38:33: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:76:9: error: 'memcpy' was not declared in this scope
   76 |         memcpy(CARD2, CARD1, sizeof(CARD2));
      |         ^~~~~~
a.cc:76:9: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

bool selectionSort(char R[36][3], int N)
{
	bool isStable = true;
	for (int i = 1; i < N; i++)
	{
		char v[3];
		memcpy(v, &R[i][0], sizeof(v));
		
		int j = i - 1;
		while ((j >= 0) && (R[j][1] > v[1]))
		{
			memcpy(R[j + 1], R[j], sizeof(R[0]));
			j--;
		}
		memcpy(R[j + 1], v, sizeof(v));
		if (R[j + 2][1] == v[1])
		{
			isStable = false;
		}
	}
	return isStable;
}

bool bubbleSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < (N - 1); i++)
	{
		for (int j = N - 1; j > i; j--)
		{
			if (R[j - 1][1] > R[j][1])
			{
				char temp[3];
				memcpy(temp, R[j], sizeof(temp));
				memcpy(R[j], R[j - 1], sizeof(R[0]));
				memcpy(R[j - 1], temp, sizeof(R[0]));
			}
		}
	}
	return isStable;
}

void traceData(char R[36][3], int N, bool isStable)
{
	for (int i = 0; i < N - 1; i++)
	{
		cout << R[i] << " ";
	}
	cout << R[N - 1] << endl;
	if (isStable)
	{
		cout << "Stable" << endl;
	}
	else
	{
		cout << "Not Stable" << endl;
	}
}

int main()
{
	char CARD1[36][3];
	char CARD2[36][3];
	int N;
	bool isStable;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> CARD1[i];
	}
	memcpy(CARD2, CARD1, sizeof(CARD2));
	isStable = selectionSort(CARD1, N);
	traceData(CARD1, N, isStable);

	isStable = bubbleSort(CARD2, N);
	traceData(CARD2, N, isStable);

	return 0;
}

Compiler output:
a.cc: In function 'bool selectionSort(char (*)[3], int)':
a.cc:11:17: error: 'memcpy' was not declared in this scope
   11 |                 memcpy(v, &R[i][0], sizeof(v));
      |                 ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<memory>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc: In function 'bool bubbleSort(char (*)[3], int)':
a.cc:39:33: error: 'memcpy' was not declared in this scope
   39 |                                 memcpy(temp, R[j], sizeof(temp));
      |                                 ^~~~~~
a.cc:39:33: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:77:9: error: 'memcpy' was not declared in this scope
   77 |         memcpy(CARD2, CARD1, sizeof(CARD2));
      |         ^~~~~~
a.cc:77:9: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<memory.h>
using namespace std;

bool selectionSort(char R[36][3], int N)
{
	bool isStable = true;
	for (int i = 1; i < N; i++)
	{
		char v[3];
		memcpy(v, &R[i][0], sizeof(v));
		
		int j = i - 1;
		while ((j >= 0) && (R[j][1] > v[1]))
		{
			memcpy(R[j + 1], R[j], sizeof(R[0]));
			j--;
		}
		memcpy(R[j + 1], v, sizeof(v));
		if (R[j + 2][1] == v[1])
		{
			isStable = false;
		}
	}
	return isStable;
}

bool bubbleSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < (N - 1); i++)
	{
			if (R[j - 1][1] >= R[j][1])
			{
				if (R[j - 1][1] == R[j][1]) isStable = false;
				char temp[3];
				memcpy(temp, R[j], sizeof(temp));
				memcpy(R[j], R[j - 1], sizeof(R[0]));
				memcpy(R[j - 1], temp, sizeof(R[0]));
			}
	}
	return isStable;
}

void traceData(char R[36][3], int N, bool isStable)
{
	for (int i = 0; i < N - 1; i++)
	{
		cout << R[i] << " ";
	}
	cout << R[N - 1] << endl;
	if (isStable)
	{
		cout << "Stable" << endl;
	}
	else
	{
		cout << "Not Stable" << endl;
	}
}

int main()
{
	char CARD1[36][3];
	char CARD2[36][3];
	int N;
	bool isStable;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> CARD1[i];
	}
	memcpy(CARD2, CARD1, sizeof(CARD2));
	isStable = selectionSort(CARD1, N);
	traceData(CARD1, N, isStable);

	isStable = bubbleSort(CARD2, N);
	traceData(CARD2, N, isStable);

	return 0;
}

Compiler output:
a.cc: In function 'bool bubbleSort(char (*)[3], int)':
a.cc:34:31: error: 'j' was not declared in this scope
   34 |                         if (R[j - 1][1] >= R[j][1])
      |                               ^
Language: C++

#include<iostream>
#include<memory>
using namespace std;
/*
bool insertSort(char R[36][3], int N)
{
	bool isStable = true;
	for (int i = 1; i < N; i++)
	{
		char v[3];
		memcpy(v, &R[i][0], sizeof(v));
		
		int j = i - 1;
		while ((j >= 0) && (R[j][1] > v[1]))
		{
			memcpy(R[j + 1], R[j], sizeof(R[0]));
			j--;
		}
		memcpy(R[j + 1], v, sizeof(v));
		if (R[j + 2][1] == v[1])
		{
			isStable = false;
		}
	}
	return isStable;
}
*/
bool bubbleSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < (N - 1); i++)
	{
		for (int j = N - 1; j > i; j--)
		{
			if (R[j - 1][1] > R[j][1])
			{
				char temp[3];
				memcpy(temp, R[j], sizeof(temp));
				memcpy(R[j], R[j - 1], sizeof(R[0]));
				memcpy(R[j - 1], temp, sizeof(R[0]));
			}
		}
	}
	return isStable;
}

bool selectionSort(char R[36][3], int N)
{
	bool isStable = true;

	for (int i = 0; i < N - 1; i++)
	{
		int minPos = i;
		for (int j = i + 1; j < N; j++)
		{
			if (R[minPos][1] > R[j][1])
			{
				minPos = j;
			}
		}
		if (i != minPos) {
			swap(R[i], R[minPos]);
		}
	}
	return isStable;
}

void traceData(char R[36][3], int N, bool isStable)
{
	for (int i = 0; i < N - 1; i++)
	{
		cout << R[i] << " ";
	}
	cout << R[N - 1] << endl;
	if (isStable)
	{
		cout << "Stable" << endl;
	}
	else
	{
		cout << "Not stable" << endl;
	}
}

int main()
{
	char CARD1[36][3];
	char CARD2[36][3];
	int N;
	bool isStable;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> CARD1[i];
	}
	memcpy(CARD2, CARD1, sizeof(CARD2));

	isStable = bubbleSort(CARD2, N);
	traceData(CARD2, N, isStable);

	isStable = selectionSort(CARD1, N);
	for (int i = 0; i < N; i++)
	{
		if (strcmp(CARD1[i], CARD2[i]) != 0) isStable = false;
	}
	traceData(CARD1, N, isStable);

	return 0;
}

Compiler output:
a.cc: In function 'bool bubbleSort(char (*)[3], int)':
a.cc:39:33: error: 'memcpy' was not declared in this scope
   39 |                                 memcpy(temp, R[j], sizeof(temp));
      |                                 ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<memory>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:98:9: error: 'memcpy' was not declared in this scope
   98 |         memcpy(CARD2, CARD1, sizeof(CARD2));
      |         ^~~~~~
a.cc:98:9: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:106:21: error: 'strcmp' was not declared in this scope
  106 |                 if (strcmp(CARD1[i], CARD2[i]) != 0) isStable = false;
      |                     ^~~~~~
a.cc:106:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include "bits\stdc++.h"
using namespace std;

struct Card { char suit; int value; };

void Print(vector<Card>& A) {
  for (int i = 0; i < A.size(); ++i) {
    if (i) cout << " ";
    cout << A[i].suit << A[i].value << endl;
  }
}

void SelectionSort(vector<Card>& A) {
  for (int i = 0; i < A.size(); ++i) {
    int mini = i;
    for (int j = i; j < A.size(); ++j) {
      if (A[j].value < A[mini].value) {
        mini = j;
      }
    }
    swap(A[i], A[mini]);
  }
}

void BubbleSort(vector<Card>& A) {
  int counter = 0;
  for (int i = 0; i < A.size(); ++i) {
    for (int j = A.size() - 1; j >= i + 1; --j) {
      if (A[j].value < A[j - 1].value) {
        swap(A[j], A[j - 1]);
        ++counter;
      }
    }
  }
}

void PrintIsStable(vector<Card>& A, vector<Card>& B) {
  auto itrB = B.begin();
  for (auto& a : A) {
    if (a.suit != (*itrB).suit) {
      cout << "Not Stable" << endl;
      return;
    }
    ++itrB;
  }
  cout << "Stable" << endl;
}

int main() {
  int n;
  cin >> n;
  vector<Card> A(n);
  for (auto& a : A)
    cin >> a.suit >> a.value;
  auto B = A;
  SelectionSort(A);
  BubbleSort(B);
  Print(A);
  cout << "Stable" << endl; //Bubble Sort is Stable
  Print(B);
  PrintIsStable(A, B);
}

Compiler output:
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include "bits\stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

struct Card { char suit, value; };

void bubble(struct Card A[], int n){
    for(int i=0; i<n; i++){
        for(int j=n-1; j>=i; j--){
            if(A[j].value < A[j-1].value)
                //swap(A[j].value, A[j-1].value);
                Card t=A[j]; A[j]=A[j-1]; A[j-1]=t;
        }
    }
}

void selection(struct Card A[], int n){
    for(int i=0; i<n; i++){
        int minj = i;
        for(int j=i; j<n; j++)
            if(A[j].value < A[minj].value) minj = j;
        //swap(A[i].value, A[minj].value);
        Card t = A[i]; A[i]=A[minj]; A[minj]=t;
    }
}

void print(struct Card A[], int n){
    for(int i=0; i<n; i++){
        if(i) cout << ' ';
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int n){
    for(int i=0; i<n; i++){
        if(C1[i].suit != C2[i].suit) return false;
    }
    return true;
}

int main(){
    Card C1[100], C2[100];
    int n;
    char ch;
    
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> C1[i].suit >> C1[i].value;
    }
    
    for(int i=0; i<n; i++) C2[i] = C1[i];
    
    bubble(C1, n);
    selection (C2, n);
    
    print(C1, n);
    cout << "Stable" << endl;
    print(C2, n);
    if(isStable(C1, C2, n)){
        cout << "Stable" << endl;
    }else{
        cout << "Not stable" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'void bubble(Card*, int)':
a.cc:11:50: error: 't' was not declared in this scope
   11 |                 Card t=A[j]; A[j]=A[j-1]; A[j-1]=t;
      |                                                  ^
Language: C++

#include<iostream>
using namespace std;

struct Card{char suit,value;};

void bubble(struct Card A[],int N){
  for(int i=0;i<N;i++){
    for(int j=N-1;j>=i;j--){
      if(A[j].value<A[j-1].value){
        Card t=A[j];A[j]=A[j-1];A[j-1]=t;
      }
    ]
  }
}

void selectionSort(struct CardA[],int N){
  for(int i=0;i<N;i++){
    int minj=i;
    for(int j=i;j<N;j++){
      if(A[j].value<A[minj].value)minj=j;
    }
    Card t=A[i];A[i]=A[minj];A[minj]=t;
  }
}

void print(struct Card A[],int N){
  for(int i=0;i<N;i++){
    if(i>0)cout<<" ";
    cout<<A[i].suit<<A[i].value;
  }
  cout<<endl;
}

bool isStable(struct Card C1[],struct CardC2[],int N){
  for(int i=0;i<N;i++){
    if(C1[i].suit!=C2[i].suit)return false;
  }
  return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin>>N;
  for(int i=0;i<N;i++){
    cin>>C1[i].suit>>C1[i].value;
  }

  for(int i=0;i<N;i++)C2[i]=C1[i];

  bubble(C1,N);
  selection(C2,N)

  print(C1,N);
  if(isStable(C1,C2,N)){
    cout<<"Stable"<<endl;
  }else{
    cout<<"Not stable"<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'void bubble(Card*, int)':
a.cc:12:5: error: expected primary-expression before ']' token
   12 |     ]
      |     ^
a.cc:16:41: error: a function-definition is not allowed here before '{' token
   16 | void selectionSort(struct CardA[],int N){
      |                                         ^
a.cc:26:34: error: a function-definition is not allowed here before '{' token
   26 | void print(struct Card A[],int N){
      |                                  ^
a.cc:34:54: error: a function-definition is not allowed here before '{' token
   34 | bool isStable(struct Card C1[],struct CardC2[],int N){
      |                                                      ^
a.cc:41:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   41 | int main(){
      |         ^~
a.cc:41:9: note: remove parentheses to default-initialize a variable
   41 | int main(){
      |         ^~
      |         --
a.cc:41:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:41:11: error: a function-definition is not allowed here before '{' token
   41 | int main(){
      |           ^
a.cc:64:2: error: expected '}' at end of input
   64 | }
      |  ^
a.cc:6:35: note: to match this '{'
    6 | void bubble(struct Card A[],int N){
      |                                   ^