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

#include<stdio.h>
#include<stdlib.h>

typedef struct {
  char  value;
}B;

int main(){

  int i,j,N,t,minj;

  scanf("%d",&N);
  B C[N][2],k;

  k.value=4;


  for(i=0;i<N;i++){
    scanf("%s",C[i]);
    C[i].value =(int)C[i][1];
  }

  for(i=0;i<N;i++){

    for(j=N-1;j>=i+1;j++){
      if(C[j].value<C[j-1].value){
        t=C[j-1].value;
        C[j-1].value=C[j].value;
        C[j].value=t;
      }

    }
  }

  for(i=0;i<N;i++){
    printf("%s",C[i]);
  }

  for(i=0;i<N;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(C[j].value < C[minj].value){
        minj = j;
          }

        t=C[minj].value;
        C[minj].value=C[j].value;
        C[j].value=t;
  }

  }


  for(i=0;i<N;i++){
    printf("%s",C[i]);
  }

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:20:9: error: '(B *)&C[i]' is a pointer; did you mean to use '->'?
   20 |     C[i].value =(int)C[i][1];
      |         ^
      |         ->
main.c:20:5: error: aggregate value used where an integer was expected
   20 |     C[i].value =(int)C[i][1];
      |     ^
main.c:26:14: error: '(B *)&C[j]' is a pointer; did you mean to use '->'?
   26 |       if(C[j].value<C[j-1].value){
      |              ^
      |              ->
main.c:26:27: error: '(B *)&C[j - 1]' is a pointer; did you mean to use '->'?
   26 |       if(C[j].value<C[j-1].value){
      |                           ^
      |                           ->
main.c:27:17: error: '(B *)&C[j - 1]' is a pointer; did you mean to use '->'?
   27 |         t=C[j-1].value;
      |                 ^
      |                 ->
main.c:28:15: error: '(B *)&C[j - 1]' is a pointer; did you mean to use '->'?
   28 |         C[j-1].value=C[j].value;
      |               ^
      |               ->
main.c:28:26: error: '(B *)&C[j]' is a pointer; did you mean to use '->'?
   28 |         C[j-1].value=C[j].value;
      |                          ^
      |                          ->
main.c:29:13: error: '(B *)&C[j]' is a pointer; did you mean to use '->'?
   29 |         C[j].value=t;
      |             ^
      |             ->
main.c:42:14: error: '(B *)&C[j]' is a pointer; did you mean to use '->'?
   42 |       if(C[j].value < C[minj].value){
      |              ^
      |              ->
main.c:42:30: error: '(B *)&C[minj]' is a pointer; did you mean to use '->'?
   42 |       if(C[j].value < C[minj].value){
      |                              ^
      |                              ->
main.c:46:18: error: '(B *)&C[minj]' is a pointer; did you mean to use '->'?
   46 |         t=C[minj].value;
      |                  ^
      |                  ->
main.c:47:16: error: '(B *)&C[minj]' is a pointer; did you mean to use '->'?
   47 |         C[minj].value=C[j].value;
      |                ^
      |                ->
main.c:47:27: error: '(B *)&C[j]' is a pointer; did you mean to use '->'?
   47 |         C[minj].value=C[j].value;
      |                           ^
      |                           ->
main.c:48:13: error: '(B *)&C[j]' is a pointer; did you mean to use '->'?
   48 |         C[j].value=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 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:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

//安定なソート
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct card {
	char Rc[3],Rcc[3];//　重大注意！！！:配列の数はEOS（空白分も入れ無くてはならない）
	int R,Ri;
};

int SelectionSort(struct card R[], int N);
int BubbleSort(struct card R[], int N);
void Swap(int *a, int *b, char aa[], char bb[]);
void isStable(struct card c[], int N);


int main(void) {

	int N ;
	char p;

	scanf("%d\n", &N);//半角スペースで区切ることができる。

	struct card c[36];
	
	int t, k;
	
	for (t = 0; t < N; t++) {scanf("%s", &c[t].Rc);}

	for (t = 0; t < N; t++) {
		p = c[t].Rc[1];
		c[t].R = atoi(&p);		
		strcpy(c[t].Rcc, c[t].Rc);
		c[t].Ri = c[t].R;
	}

	BubbleSort(c, N);
	for (k = 0; k < N; k++) {
		if (k > 0) { 
			printf(" "); }
		printf("%s", c[k].Rc);
	}
	isStable(c,N);
	
	for (t = 0; t < N; t++) {
		strcpy(c[t].Rc, c[t].Rcc);
		c[t].R = c[t].Ri;
	}
	
	SelectionSort(c, N);
	printf("\n");
	for (k = 0; k < N; k++) {
		if (k > 0) {
			printf(" ");
		}
		printf("%s", c[k].Rc);
	}
	isStable(c, N);
	for (;;) {
return 0;
}

int SelectionSort(struct card c[], int N) {
	int i, j, minj;
	int count = 0;
	for (i = 0; i < N - 1; i++) {
		minj = i;
		for (j = i; j < N; j++) {
			if (c[j].R < c[minj].R) {
				minj = j;
			}
		}
		Swap(&c[i].R, &c[minj].R, c[i].Rc, c[minj].Rc);
		if (i != minj) {
			count++;
		}
	}
	return count;
}
int  BubbleSort(struct card c[], int N) {
	int flag = 1;
	int count = 0;
	int j;
	while (flag != 0) {	//forにして、ソートを終える場所を少しづつ変えていけば完璧。（恐らくオーダーは変わらない。）
		flag = 0;
		for (j = N - 1; j >= 1; j--) {
			if (c[j].R < c[j-1].R) {
				Swap(&c[j].R, &c[j - 1].R, c[j].Rc, c[j - 1].Rc);
				flag = 1;
				count++;
			}
		}
	}
	return count;
}
void Swap(int *a, int *b,char aa[] ,char bb[]){
	int k,i;
	char t[2];
	
	k = *a;
	*a = *b;
	*b = k;

	for (i = 0; i < 2; i++) {
		t[i] = aa[i];
		aa[i] = bb[i];
		bb[i] = t[i];
	}
}
void isStable(struct card c[], int N) {
	int i, j, a, b;
	for (i = 0; i < N; i++) {
		for (j = i + 1; j < N; j++) {
			for (a = 0; a < N; a++) {
				for (b = a + 1; b < N; b++) {
					if (c[j].Ri == c[i].Ri && strcmp(c[i].Rcc,c[b].Rc) == 0 && strcmp(c[j].Rcc,c[a].Rc) == 0){
						printf("\nNot stable");
						return ;
					}
				}
			}
		}
	}
	printf("\nStable");
	return ;
}



Compiler output:
main.c: In function 'main':
main.c:127:1: error: expected declaration or statement at end of input
  127 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
 
#define NMIN 1
#define NMAX 36
 
struct Number{
char mark;
char value;  
};
 
 
void bubble(struct Number A[],int N){
  int i,j;
 struct Number t;
  for(i=0;i<N;i++){
for(j=N-1;j>=i;j--){
  if(A[j].value<A[j-1].value){
    t=A[j];
    A[j]=A[j-1];
    A[j-1]=t;
  }
}    
  }
}
 
void selections(struct Number A[],int N){
  int i,j,minj;
 struct Number t;
  for(i=0;i<N;i++){
minj=i; 
for(j=i;j<N;j++){
  if(A[j].value<A[minj].value) minj=j;
}
t=A[i];
A[i]=A[minj];
A[minj]=t;
  }
}
 
void print(struct Number A[],int N){
int i;
for(i=0;i<N;i++){
  if(i>0) printf(" ");
  printf("%c%c",A[i].mark,A[i].value);
}
 printf("\n");
}
 
int isStable(struct Number N1[],struct Card N2[],int N){
int i;
  for(i=0;i<N;i++){
    if(N1[i].mark != N2[i].mark) return 0;
  }
  return 1;
}
 
 
 
int main(){
int N,i,j;
struct Card C1[NMAX],C2[NMAX];
char ch;
scanf("%d",&N);
if(N<NMIN||N>NMAX) exit(1);
for(i=0;i<N;i++){
  scanf(" %c%c",&C1[i].suit,&C1[i].value);
}
for(i=0;i<N;i++){
C2[i]=C1[i];
}
bubble(C1,N);
selection(C2,N);
 
print(C1,N);
printf("Stable\n");
print(C2,N);
if(isStable(C1,C2,N)==1){
  printf("Stable\n");
}
else{
  printf("Not stable\n");
}
  return 0;
}



Compiler output:
main.c:50:45: error: array type has incomplete element type 'struct Card'
   50 | int isStable(struct Number N1[],struct Card N2[],int N){
      |                                             ^~
main.c:50:40: warning: 'struct Card' declared inside parameter list will not be visible outside of this definition or declaration
   50 | int isStable(struct Number N1[],struct Card N2[],int N){
      |                                        ^~~~
main.c: In function 'main':
main.c:62:13: error: array type has incomplete element type 'struct Card'
   62 | struct Card C1[NMAX],C2[NMAX];
      |             ^~
main.c:62:22: error: array type has incomplete element type 'struct Card'
   62 | struct Card C1[NMAX],C2[NMAX];
      |                      ^~
main.c:73:1: error: implicit declaration of function 'selection'; did you mean 'selections'? [-Wimplicit-function-declaration]
   73 | selection(C2,N);
      | ^~~~~~~~~
      | selections
main.c:78:16: error: type of formal parameter 2 is incomplete
   78 | if(isStable(C1,C2,N)==1){
      |                ^~
Language: C

#include<stdio.h>
#include<stdlib.h>
 
#define NMIN 1
#define NMAX 36
 
struct Number{
char mark;
char value;  
};
 
 
void bubble(struct Number A[],int N){
  int i,j;
 struct Number t;
  for(i=0;i<N;i++){
for(j=N-1;j>=i;j--){
  if(A[j].value<A[j-1].value){
    t=A[j];
    A[j]=A[j-1];
    A[j-1]=t;
  }
}    
  }
}
 
void selections(struct Number A[],int N){
  int i,j,minj;
 struct Number t;
  for(i=0;i<N;i++){
minj=i; 
for(j=i;j<N;j++){
  if(A[j].value<A[minj].value) minj=j;
}
t=A[i];
A[i]=A[minj];
A[minj]=t;
  }
}
 
void print(struct Number A[],int N){
int i;
for(i=0;i<N;i++){
  if(i>0) printf(" ");
  printf("%c%c",A[i].mark,A[i].value);
}
 printf("\n");
}
 
int isStable(struct Number N1[],struct Card N2[],int N){
int i;
  for(i=0;i<N;i++){
    if(N1[i].mark != N2[i].mark) return 0;
  }
  return 1;
}
 
 
 
int main(){
int N,i,j;
struct Number N1[NMAX],N2[NMAX];
char ch;
scanf("%d",&N);
if(N<NMIN||N>NMAX) exit(1);
for(i=0;i<N;i++){
  scanf(" %c%c",&N1[i].mark,&N1[i].value);
}
for(i=0;i<N;i++){
N2[i]=N1[i];
}
bubble(N1,N);
selection(N2,N);
 
print(N1,N);
printf("Stable\n");
print(N2,N);
if(isStable(N1,N2,N)==1){
  printf("Stable\n");
}
else{
  printf("Not stable\n");
}
  return 0;
}



Compiler output:
main.c:50:45: error: array type has incomplete element type 'struct Card'
   50 | int isStable(struct Number N1[],struct Card N2[],int N){
      |                                             ^~
main.c:50:40: warning: 'struct Card' declared inside parameter list will not be visible outside of this definition or declaration
   50 | int isStable(struct Number N1[],struct Card N2[],int N){
      |                                        ^~~~
main.c: In function 'main':
main.c:73:1: error: implicit declaration of function 'selection'; did you mean 'selections'? [-Wimplicit-function-declaration]
   73 | selection(N2,N);
      | ^~~~~~~~~
      | selections
main.c:78:16: error: type of formal parameter 2 is incomplete
   78 | if(isStable(N1,N2,N)==1){
      |                ^~
Language: C

#include<stdio.h>
#include<stdlib.h>
 
#define NMIN 1
#define NMAX 36
 
struct Number{
char mark;
char value;  
};
 
 
void bubble(struct Number A[],int N){
  int i,j;
 struct Number t;
  for(i=0;i<N;i++){
for(j=N-1;j>=i;j--){
  if(A[j].value<A[j-1].value){
    t=A[j];
    A[j]=A[j-1];
    A[j-1]=t;
  }
}    
  }
}
 
void selections(struct Number A[],int N){
  int i,j,minj;
 struct Number t;
  for(i=0;i<N;i++){
minj=i; 
for(j=i;j<N;j++){
  if(A[j].value<A[minj].value) minj=j;
}
t=A[i];
A[i]=A[minj];
A[minj]=t;
  }
}
 
void print(struct Number A[],int N){
int i;
for(i=0;i<N;i++){
  if(i>0) printf(" ");
  printf("%c%c",A[i].mark,A[i].value);
}
 printf("\n");
}
 
int isStable(struct Number N1[],struct Number N2[],int N){
int i;
  for(i=0;i<N;i++){
    if(N1[i].mark != N2[i].mark) return 0;
  }
  return 1;
}
 
 
 
int main(){
int N,i,j;
struct Number N1[NMAX],N2[NMAX];
char ch;
scanf("%d",&N);
if(N<NMIN||N>NMAX) exit(1);
for(i=0;i<N;i++){
  scanf(" %c%c",&N1[i].mark,&N1[i].value);
}
for(i=0;i<N;i++){
N2[i]=N1[i];
}
bubble(N1,N);
selection(N2,N);
 
print(N1,N);
printf("Stable\n");
print(N2,N);
if(isStable(N1,N2,N)==1){
  printf("Stable\n");
}
else{
  printf("Not stable\n");
}
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:73:1: error: implicit declaration of function 'selection'; did you mean 'selections'? [-Wimplicit-function-declaration]
   73 | selection(N2,N);
      | ^~~~~~~~~
      | selections
Language: C

#include<stdio.h>
#include<string.h>
#define N 100

void BubbleSort(char[][],int);
void SelectionSort(char[][],int);

int main(){
  int i,j,n,temp,cnt=0,minj;
  char A[N][3],B[N][3],S[N][3];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",A[i]);
    strcpy(B[i],A[i]);
    strcpy(S[i],A[i]);
  }
  BubbleSort(B,n);
  SelectionSort(S,n);

  int check=0;
  for(i=0;i<n;i++){
    if(strcmp(B[i],S[i])!=0)check=1;
  }
  if(check==0) printf("Stable\n");
  else printf("Not stable\n");
  return 0;
}
void BubbleSort(char A[N][3],int n){
  int i,j;
  char temp[3];
      for(i=0;i<n;i++){
	for(j=n-1;j>i;j--){
	  if(A[j][1]<A[j-1][1]){
	  strcpy(temp,A[j]);
	  strcpy(A[j],A[j-1]);
	  strcpy(A[j-1],temp);
	  }
	}
      }
      for(i=0;i<n-1;i++){
	printf("%s ",A[i]);
      }
     printf("%s\n",A[n-1]);
     printf("Stable\n");
}
void SelectionSort(char A[N][3],int n){
  int i,j,minj;
  char temp[3];
    for(i=0;i<n;i++){
      minj=i;
      for(j=i;j<n;j++){
	if(A[j][1]<A[minj][1])minj=j;
      }
      strcpy(temp,A[i]);
      strcpy(A[i],A[minj]);
      strcpy(A[minj],temp);
    }
  for(i=0;i<n-1;i++){
  printf("%s ",A[i]);
  }
  printf("%s\n",A[n-1]);
}




Compiler output:
main.c:5:21: error: array type has incomplete element type 'char[]'
    5 | void BubbleSort(char[][],int);
      |                     ^
main.c:5:21: note: declaration of multidimensional array must have bounds for all dimensions except the first
main.c:6:24: error: array type has incomplete element type 'char[]'
    6 | void SelectionSort(char[][],int);
      |                        ^
main.c:6:24: note: declaration of multidimensional array must have bounds for all dimensions except the first
main.c: In function 'main':
main.c:17:14: error: type of formal parameter 1 is incomplete
   17 |   BubbleSort(B,n);
      |              ^
main.c:18:17: error: type of formal parameter 1 is incomplete
   18 |   SelectionSort(S,n);
      |                 ^
Language: C

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

void bubble(struct Card A[], int N){
  int i,j;
  for(i = 0; i<N;i++){
    for(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 selection(struct Card A[],int N){
  int i,j;
  for(i = 0; i<N; i++){
    int minj = i;
    for(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){
  int i;
  for(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){
  int i;
  for(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,i;
  char ch;

  cin >> N;
  for(i = 0; i<N; i++){
    cin >> C1[i].suit >> C1[i].value;
  }
  for(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:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

struct Card{
  char suit;
  char value;
};

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

void selection(Card A[], int n){
  int i, j, mini;
  Card t;
 for ( i = 1; i <= n; i++ ){
    mini = i;
    for ( j = i; j <= n; j++ ){
      if ( A[j].value < A[mini].value ) mini = j;
    }
    t = A[i]; A[i] = A[mini]; A[mini] = t;
  }
}

void print(Card A[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i >1) printf(" ");
    printf("%c%c", A[i].suit, A[i].value);
  }
  printf("\n");
}

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

int main(){
  Card C1[101], C2[101];
  int n, i;
  char ch;

  scanf("%d\n", &n);
  for ( i = 1; i <= n; i++ ){
    scanf("%c%c ", &C1[i].suit, &C1[i].value);
  }

  for ( i = 1; i <= n; i++ ) C2[i] = C1[i];

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

  print(C1, n);
  printf("Stable\n");
  print(C2, n);
  if ( isStable(C1, C2, n) && 0 ){
    printf("Stable\n");
  } else {
    printf("Not stable\n");
  }

  return 0;
}

Compiler output:
main.c:8:13: error: unknown type name 'Card'
    8 | void bubble(Card A[], int n){
      |             ^~~~
main.c:20:16: error: unknown type name 'Card'
   20 | void selection(Card A[], int n){
      |                ^~~~
main.c:32:12: error: unknown type name 'Card'
   32 | void print(Card A[], int n){
      |            ^~~~
main.c:41:14: error: unknown type name 'Card'
   41 | int isStable(Card C1[], Card C2[], int n){
      |              ^~~~
main.c:41:25: error: unknown type name 'Card'
   41 | int isStable(Card C1[], Card C2[], int n){
      |                         ^~~~
main.c: In function 'main':
main.c:50:3: error: unknown type name 'Card'; use 'struct' keyword to refer to the type
   50 |   Card C1[101], C2[101];
      |   ^~~~
      |   struct 
main.c:56:26: error: request for member 'suit' in something not a structure or union
   56 |     scanf("%c%c ", &C1[i].suit, &C1[i].value);
      |                          ^
main.c:56:39: error: request for member 'value' in something not a structure or union
   56 |     scanf("%c%c ", &C1[i].suit, &C1[i].value);
      |                                       ^
main.c:61:3: error: implicit declaration of function 'bubble' [-Wimplicit-function-declaration]
   61 |   bubble(C1, n);
      |   ^~~~~~
main.c:62:3: error: implicit declaration of function 'selection' [-Wimplicit-function-declaration]
   62 |   selection(C2, n);
      |   ^~~~~~~~~
main.c:64:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   64 |   print(C1, n);
      |   ^~~~~
      |   printf
main.c:67:8: error: implicit declaration of function 'isStable' [-Wimplicit-function-declaration]
   67 |   if ( isStable(C1, C2, n) && 0 ){
      |        ^~~~~~~~
Language: C

#include<stdio.h>
int main(void){
  int N,i,j,n,mini=0,S=0,J=0,stability=0;
  int figure1[36],figure2[36],order1[36],order2[36];
  char symbol1[36],symbol2[36],K;
  scanf("%d",&N);
  for(i = 0 ; i < N ; i++){
    scanf(" %c%d",&symbol1[i],&figure1[i]);
  }
  for(n = 0 ; n < N ; n++){
    s[n] = n;
  }
  for(i = 0 ; i < N ; i++){
    figure2[i] = figure1[i];
    order2[i] = order1[i];
    symbol2[i] = symbol1[i];
  }
  /*BubbleSort*/
  for(i = 0 ; i < N ; i++){
    for(j = N-1 ; j > i ; j--){
      if(figure1[j] < figure1[j-1]){
	S = figure1[j];
	K = symbol1[j];
	J = order1[j];

	figure1[j] = figure1[j-1];
	symbol1[j] = symbol1[j-1];
	order1[j] = order1[j-1];

	figure1[j-1] = S;
	symbol1[j-1] = K;
	order1[j-1] = J;
      }
    }
  }
  for(i = 0 ; i < N ; i++){
    printf("%c%d",symbol1[i],figure1[i]);
    if(i < N-1){
      printf(" ");
      if(figure1[i] == figure1[i+1]){
	if(order1[i] > order1[i+1]){
	  stability = 1;
	}
      } 
    }
    else printf("\n");
  }
  if(stability == 1){
    printf("Not stable\n");
  } else {
    printf("Stable\n");
  }
  stability = 0;
  
  /*SelectionSort*/
  for(i = 0 ; i < N ; i++){
    mini = i;
    for(j = i+1 ; j < N ; j++){
      if(figure2[j] < figure2[mini]){
	mini = j;
      }
    }
    S = figure2[i];
    K = symbol2[i];
    J = order2[i];

    figure2[i] = figure2[mini];
    symbol2[i] = symbol2[mini];
    order2[i] = order2[mini];

    figure2[mini] = S;
    symbol2[mini] = K;
    order2[mini] = J;
  }
  for(i = 0 ; i < N ; i++){
    printf("%c%d",symbol2[i],figure2[i]);
    if(i < N-1){
      printf(" ");
      if(figure2[i] == figure2[i+1]){
	if(order2[i] > order2[i+1]){
	  stability = 1;
	}
      } 
    }
    else printf("\n");
  }
  if(stability == 1){
    printf("Not stable\n");
  } else {
    printf("Stable\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:5: error: 's' undeclared (first use in this function)
   11 |     s[n] = n;
      |     ^
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

void SelectionSort(char ch[],char A[], int n)
{
  int i,j,mini;
  char t;
  for(i=0;i<n;i++){
    mini=i;
    for(j=i;j<n;j++){
      if (A[j]<A[mini]){
        mini=j;
      }
    }
    t=A[i];
    A[i]=A[mini];
    A[mini]=t;
    t=ch[i];
    ch[i]=ch[mini];
    ch[mini]=t;
  }
}

void BubbleSort(char ch[],char A[], int n)
{
  int i,j;
  char t;
  for(i=0;i<n;i++){
    for(j=n-1;i<j;j--){
      if (A[j]<A[j-1]){
        t=A[j];
        A[j]=A[j-1];
        A[j-1]=t;
        t=ch[j];
        ch[j]=ch[j-1];
        ch[j-1]=t;
      }
    }
  }
}

int main()
{
  int n,i;
  char ori_num[36],ori_ch[36],num0[36],ch0[36],num1[36],ch1[36];
  char str[2];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",str);
    ch0[i]=str[0];
    num0[i]=str[1];
    ori_ch[i]=str[0];
    ori_num[i]=str[1];
  }

  BubbleSort(ch0,num0,n);
  for(i=0;i<n-1;i++){
    printf("%c%c ",ch0[i],num0[i]);
  }
  printf("%c%c\n",ch0[n-1],num0[n-1]);
  printf("Stable\n");

  for(i=0;i<n;i++){
    ch1[i]=ori_ch[i];
    num1[i]=ori_num[i];
  }
  SelectionSort(ch1,num1,n);
  for(i=0;i<n-1;i++){
    printf("%c%c ",ch1[i],num1[i]);
  }
  printf("%c%c\n",ch1[n-1],num1[n-1]);

  if ((strncmp(num0,num1,n)==0) && (strncmp(ch0,ch1,n)==0)){
    printf("Stable\n");
  }else{
    printf("Not stable\n");
  }
return0;
}

Compiler output:
main.c: In function 'main':
main.c:72:8: error: implicit declaration of function 'strncmp' [-Wimplicit-function-declaration]
   72 |   if ((strncmp(num0,num1,n)==0) && (strncmp(ch0,ch1,n)==0)){
      |        ^~~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strncmp'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:72:26: warning: 'strncmp' argument 3 type is 'int' where 'long unsigned int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   72 |   if ((strncmp(num0,num1,n)==0) && (strncmp(ch0,ch1,n)==0)){
      |                          ^
<built-in>: note: built-in 'strncmp' declared here
main.c:72:53: warning: 'strncmp' argument 3 type is 'int' where 'long unsigned int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   72 |   if ((strncmp(num0,num1,n)==0) && (strncmp(ch0,ch1,n)==0)){
      |                                                     ^
<built-in>: note: built-in 'strncmp' declared here
main.c:77:1: error: 'return0' undeclared (first use in this function)
   77 | return0;
      | ^~~~~~~
main.c:77:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

struct Card{
	char suit;
	char value;
};

void swap(Card *a, Card *b){
	Card t;
	t = *b;
	*b = *a;
	*a = t;
}

void BubbleSort(Card *C ,int n){
	int i,j;
	for (i = 0; i <= n - 1;i++){
		for (j = n - 1; j >= i + 1;j--){
			if (C[j].value < C[j - 1].value){
				swap(&C[j], &C[j - 1]);
			}
		}
	}
}

void SelectionSort(Card *C ,int n){
	int i, j, mini;
	for (i = 0; i<n-1;i++){
		mini = i;
		for (j = i; j<=n-1;j++){
			if (C[j].value < C[mini].value){
				mini = j;
			}
		}
			swap(&C[i], &C[mini]);
	}
}

int check(Card *C1 ,Card *C2 ,int n){
	int i,j,k;
	for (i = 0; i < n;i++){
		if (C2[i].suit != C1[i].suit){ return 0; }
	}
	return 1;
}

int main(){
	struct Card C1[101], C2[101];
	int n, i;
	char ch;

	scanf("%d%c", &n, &ch);
	for (i = 0; i < n; i++){
		scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
	}

	for (i = 0; i < n; i++){
		C2[i] = C1[i];
	}
	BubbleSort(C2,n);
	for (i = 0; i < n; i++){
		printf("%c%c",C2[i].suit,C2[i].value);
		if (i < n - 1){ printf(" "); }
	}
	printf("\n");
	printf("Stable\n");


	SelectionSort(C1, n);
	for (i = 0; i < n; i++){
		printf("%c%c", C2[i].suit, C2[i].value);
		if (i < n - 1){ printf(" "); }
	}
	printf("\n");
	printf("%s", check(C1, C2, n) ? "Stable\n" : "Not stable\n");
	return 0;
}

Compiler output:
main.c:8:11: error: unknown type name 'Card'
    8 | void swap(Card *a, Card *b){
      |           ^~~~
main.c:8:20: error: unknown type name 'Card'
    8 | void swap(Card *a, Card *b){
      |                    ^~~~
main.c:15:17: error: unknown type name 'Card'
   15 | void BubbleSort(Card *C ,int n){
      |                 ^~~~
main.c:26:20: error: unknown type name 'Card'
   26 | void SelectionSort(Card *C ,int n){
      |                    ^~~~
main.c:39:11: error: unknown type name 'Card'
   39 | int check(Card *C1 ,Card *C2 ,int n){
      |           ^~~~
main.c:39:21: error: unknown type name 'Card'
   39 | int check(Card *C1 ,Card *C2 ,int n){
      |                     ^~~~
main.c: In function 'main':
main.c:60:9: error: implicit declaration of function 'BubbleSort' [-Wimplicit-function-declaration]
   60 |         BubbleSort(C2,n);
      |         ^~~~~~~~~~
main.c:69:9: error: implicit declaration of function 'SelectionSort' [-Wimplicit-function-declaration]
   69 |         SelectionSort(C1, n);
      |         ^~~~~~~~~~~~~
main.c:75:22: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
   75 |         printf("%s", check(C1, C2, n) ? "Stable\n" : "Not stable\n");
      |                      ^~~~~
Language: C

#include <stdio.h>


typedef struct {
    char ch;
    char value;
} Card;

Card C1[37], C2[37];

void bubble(int);
void select(int);
void swap(Card *, Card *);
void IsStable(Card *, int);

//main
int main(void){ 

    int n, i;
    char ch;
    scanf("%d%c", &n, &ch);
    for (i = 0; i < n; i++) {
        scanf("%c%c%c", &C1[i].ch, &C1[i].value, &ch);
    }

    // 配列コピー
    for (i = 0; i < n; i++) {
        C2[i].ch = C1[i].ch;
        C2[i].value= C1[i].value;
    }

    bubble(n);
    select(n);

    return 0;
}


void swap(Card *x, Card *y){
    Card temp;
    temp = *x;
    *x = *y;
    *y = temp;
}

void bubble(int n){

    int i, j;

    //sort
    for (i = 0; i < n-1; i++) {
        for (j = n-1; j > 0 ; j--) {
            if(C1[j].value < C1[j-1].value) swap(&C1[j], &C1[j-1]);
        }
    }

    // print
    for (i = 0; i < n-1; i++) {
        printf("%c%c ", C1[i].ch, C1[i].value);
    }
    printf("%c%c\n", C1[n].ch, C1[n].value);
    IsStable(C1, n);
}

void select(int n){

    int min, i, j;

    // sort
    for (i = 0; i < n-1; i++) {
        min = i;
        for (j = i; j < n; j++) {
            if(C2[j].value < C2[min].value) min = j;
        }
        swap(&C2[i], &C2[min]);
    }

    // print
    for (i = 0; i < n-1; i++) {
        printf("%c%c ", C2[i].ch, C2[i].value);
    }
    printf("%c%c\n", C1[n].ch, C1[n].value);
    IsStable(C2, n);
}

void IsStable(Card c, int n){

    int cnt = 0, i;
    
    for (i = 0; i < n; i++) {
        if(c[i].value == C1[i].value && c[i].ch == C1[i].ch)
            cnt++;
    }
    if(n == cnt) printf("Stable\n");
    else printf("Not stable\n");

}

Compiler output:
main.c:86:6: error: conflicting types for 'IsStable'; have 'void(Card,  int)'
   86 | void IsStable(Card c, int n){
      |      ^~~~~~~~
main.c:14:6: note: previous declaration of 'IsStable' with type 'void(Card *, int)'
   14 | void IsStable(Card *, int);
      |      ^~~~~~~~
main.c: In function 'IsStable':
main.c:91:13: error: subscripted value is neither array nor pointer nor vector
   91 |         if(c[i].value == C1[i].value && c[i].ch == C1[i].ch)
      |             ^
main.c:91:42: error: subscripted value is neither array nor pointer nor vector
   91 |         if(c[i].value == C1[i].value && c[i].ch == C1[i].ch)
      |                                          ^
Language: C

#include<stdio.h>

struct Card{
  char suit;
  char value;
};



int main(){
  struct Card C1[100], C2[100],f;
  int n, i,j,mini,x=0;
  char ch;

  scanf("%d%c", &n, &ch);
  for ( i = 0; i < n; i++ ){
    scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
  }
  for ( i = 0; i < n; i++ ){
    C2[i] = C1[i];
  }
  for(i = 0; i < n; i++){
    for(j = n-1; j >= i+1; j--){
      if(C1[j].value < C1[j-1].value){
	f = C1[j];      
	C1[j] = C1[j-1]; 
	C1[j-1] = f;
      }
      
    }
  }
  
  for(i = 0; i < n; i++){
    
    if(i< n-1){
      printf(" ");
    }
    printf("%c%c",C1[i].suit,C1[i].value);
  } printf("\n");
  
  printf("Stable\n");
  
  for(i = 0; i <= n-1; i++){
    mini = i;
    for(j = i; j <= n-1; j++){
      
      if(C2[j].value < C2[mini].value){
	mini = j;
      }
    } 
    
    f = C2[i];      
    C2[i] = C2[mini]; 
    C2[mini] = f; 
  }
  for(i = 0; i < n; i++){
    if(C1[i].suit != C2[i].suit){
      x = 1;
    }
  }
  
  for(i = 0; i < n; i++){
    
    if(i<n-1){
      printf(" ");
    }
    printf("%c%c",C2[i].suit,C2[i].value);
  }   
  printf("\n");

  if(x == 1){
    printf("Not Stable\n");
  }
  else {
    printf("Stable\n");
  }
  
  return 0;

Compiler output:
main.c: In function 'main':
main.c:78:3: error: expected declaration or statement at end of input
   78 |   return 0;
      |   ^~~~~~
Language: C

#include<stdio.h>

struct Card{
  char suit;
  char value;
};



int main(){
  struct Card C1[100], C2[100],f;
  int n, i,j,mini,x=0;
  char ch;

  scanf("%d%c", &n, &ch);
  for ( i = 0; i < n; i++ ){
    scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
  }
  for ( i = 0; i < n; i++ ){
    C2[i] = C1[i];
  }
  for(i = 0; i < n; i++){
    for(j = n-1; j >= i+1; j--){
      if(C1[j].value < C1[j-1].value){
	f = C1[j];      
	C1[j] = C1[j-1]; 
	C1[j-1] = f;
      }
      
    }
  }
  
  for(i = 0; i < n; i++){
    printf("%c%c",C1[i].suit,C1[i].value);
    if(i< n-1){
      printf(" ");
    }
  } 
  printf("\n");
  
  printf("Stable\n");
  
  for(i = 0; i <= n-1; i++){
    mini = i;
    for(j = i; j <= n-1; j++){
      
      if(C2[j].value < C2[mini].value){
	mini = j;
      }
    } 
    
    f = C2[i];      
    C2[i] = C2[mini]; 
    C2[mini] = f; 
  }
  for(i = 0; i < n; i++){
    if(C1[i].suit != C2[i].suit){
      x = 1;
    }
  }
  
  for(i = 0; i < n; i++){
    printf("%c%c",C2[i].suit,C2[i].value);
    if(i<n-1){
      printf(" ");
    }
    
  }   
  printf("\n");

  if(x == 1){
    printf("Not Stable\n");
  }
  else {
    printf("Stable\n");
  }
  
  return 0;
}
printf("%c%c",C1[i].suit,C1[i].value)

Compiler output:
main.c:80:8: error: expected declaration specifiers or '...' before string constant
   80 | printf("%c%c",C1[i].suit,C1[i].value)
      |        ^~~~~~
main.c:80:15: error: unknown type name 'C1'
   80 | printf("%c%c",C1[i].suit,C1[i].value)
      |               ^~
main.c:80:26: error: unknown type name 'C1'
   80 | printf("%c%c",C1[i].suit,C1[i].value)
      |                          ^~
Language: C

#include<stdio.h>

struct Card{
  char suit;
  char value;
};

typedef struct Card Card;
 
void swap(Card *a, Card *b){
    Card k;
    k = *b;
    *b = *a;
    *a = k;
}
 
void Bubble(Card *C, int n){
    int i, j;
    for (i = 0; i <= n - 1; i++){
        for (j = n - 1; j >= i + 1; j--){
            if (C[j].value < C[j - 1].value){
                swap(&C[j], &C[j - 1]);
            }
        }
    }
}
 
void Selection(Card *C, int n){
    int i, j, min;
    for (i = 0; i<n - 1; i++){
        min = i;
        for (j = i; j <= n - 1; j++){
            if (C[j].value < C[min].value){
                min = j;
            }
        }
        swap(&C[i], &C[min]);
    }
}
 
int check(Card *C1, Card *C2, int n){
    int i, j, k;
    for (i = 0; i < n; i++){
        if (C2[i].suit != C1[i].suit){ return 0; }
    }
    return 1;
}

int main(){
  struct Card C1[101], C2[101];
  int n, i;
  char c;

  scanf("%d%c", &n, &c);
  for ( i = 1; i <= n; i++ ){
    scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c);
  }

for (i = 0; i < n; i++){
        C2[i] = C1[i];

Compiler output:
main.c: In function 'main':
main.c:60:9: error: expected declaration or statement at end of input
   60 |         C2[i] = C1[i];
      |         ^~
main.c:60:9: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
 
struct Card{
    char suit;
    char value;
};
 
typedef struct Card Card;
 
 
void Bubble(Card *C, int n){
    int i, j;
    for (i = 0; i <= n - 1; i++){
        for (j = n - 1; j >= i + 1; j--){
            if (C[j].value < C[j - 1].value){
                swap(&C[j], &C[j - 1]);
            }
        }
    }
}
 
void Selection(Card *C, int n){
    int i, j, min,;
    for (i = 0; i<n - 1; i++){
        min = i;
        for (j = i; j <= n - 1; j++){
            if (C[j].value < C[min].value){
                min = j;
            }
        }
        Card k;
    	k = *b;
    	*b = *a;
    	*a = k;
    }
}
 
int check(Card *C1, Card *C2, int n){
    int i, j, k;
    for (i = 0; i < n; i++){
        if (C2[i].suit != C1[i].suit){ return 0; }
    }
    return 1;
}
 
int main(){
    struct Card C1[101], C2[101];
    int n, i;
    char ch;
 
    scanf("%d%c", &n, &ch);
    for (i = 0; i < n; i++){
        scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
    }
 
    for (i = 0; i < n; i++){
        C2[i] = C1[i];
    }
    Bubble(C2, n);
    for (i = 0; i < n; i++){
        printf("%c%c", C2[i].suit, C2[i].value);
        if (i < n - 1){ printf(" "); }
    }
    printf("\n");
    printf("Stable\n");
 
 
    Selection(C1, n);
    for (i = 0; i < n; i++){
        printf("%c%c", C1[i].suit, C1[i].value);
        if (i < n - 1){ printf(" "); }
    }
    printf("\n");
    printf("%s", check(C1, C2, n) ? "Stable\n" : "Not stable\n");
    return 0;
}

Compiler output:
main.c: In function 'Bubble':
main.c:16:17: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   16 |                 swap(&C[j], &C[j - 1]);
      |                 ^~~~
main.c: In function 'Selection':
main.c:23:19: error: expected identifier or '(' before ';' token
   23 |     int i, j, min,;
      |                   ^
main.c:32:14: error: 'b' undeclared (first use in this function)
   32 |         k = *b;
      |              ^
main.c:32:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:15: error: 'a' undeclared (first use in this function)
   33 |         *b = *a;
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string disp(bool x){
    return x ? "Yes" : "No";
}

void BubbleSort(int n,int x[],string y[]){
    int flag = 1;
    int ok = 0;
    
    while(flag) {
        flag = 0;
        for(int i=n-1 ; i>=ok+1 ; i--){
            if(x[i] < x[i-1]) {
                swap(x[i],x[i-1]);
                swap(y[i],y[i-1]);
                flag = 1;
            }
        }
        ok++;
    }
    
    rep(i,n) cout << y[i] << (i != n-1 ? ' ': '\n');
    return;
 }

void SelectSort(int n,int x[],string y[]){
    rep(i,n){
        int minj = i;
        for(int j=i ; j<n ; j++){
            if(x[minj]>x[j]) minj = j;
        }
        if(x[i]>x[minj]) {
            swap(x[i],x[minj]);
            swap(y[i],y[minj]);
        }
    }
    rep(i,n) cout << y[i] << (i != n-1 ? ' ': '\n');
    return;
}

string check(int n,string x[n] , string y[n]){
    bool flag = 1;
    rep(i,n){
        if(x[i] != y[i]) flag = 0;
    }
    return(flag ? "Stable" : "Not Stable");
}

int main(){
    int n; cin >> n;
    string c[n] ,d[n]; int a[n],b[n];
    rep(i,n) {
        cin >> c[i];
        d[i] = c[i];
        
        a[i] = c[i][1]-'0';
        b[i] = a[i];
    }
    BubbleSort(n, a, c);
    cout << "Stable" << endl;
    SelectSort(n, b, d);
    cout << check(n,c,d) << endl;

}







Compiler output:
a.cc:58:30: error: use of parameter outside function body before ']' token
   58 | string check(int n,string x[n] , string y[n]){
      |                              ^
a.cc:58:31: error: expected ')' before ',' token
   58 | string check(int n,string x[n] , string y[n]){
      |             ~                 ^~
      |                               )
a.cc:58:41: error: expected initializer before 'y'
   58 | string check(int n,string x[n] , string y[n]){
      |                                         ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int bubble(int n, char a[n], int b[n]){
    for(int i = 0; i < n; i++){
        for(int j = n-1; j > 0; j--){
            if(b[j] < b[j-1]){
                swap(b[j], b[j-1]);
                swap(a[j], a[j-1]);
            }
        }
    }
    return 0;
}
int selection(int n, char a[n], int b[n]){
    int minj;
    for(int i = 0; i < n; i++){
        minj = i;
        for(int j = i+1; j < n; j++){
            if(b[minj] > b[j]){
                minj = j;
            }
        }
        if(minj == i){
            continue;
        }
        else{
            swap(b[i], b[minj]);
            swap(a[i], a[minj]);
        }
        
    }
    

    return 0;
}
bool isstable(int n, char a[n], char b[n]){
    for(int i = 0; i < n; i++){
        if(a[i] != b[i]){
            return false;
        }
    }
    return true;
}
int main(void){
    int n;
    cin >> n;
    int b[n];
    char c[n];
    for(int i = 0; i < n; i++){
        cin >> c[i] >> b[i];
    }
    char c1[n];
    for(int i = 0; i < n; i++){
        c1[i] = c[i];
    }
    
    bubble(n, c1, b);
    selection(n, c, b);
    
    for(int i = 0; i < n; i++){
        if(i == 0){
            cout << c1[i] << b[i];
        }
        else{
            cout << ' ' << c1[i] << b[i];
        }
    }
    cout << endl << "Stable" << endl;
    for(int i = 0; i < n; i++){
        if(i == 0){
            cout << c[i] << b[i];
        }
        else{
            cout << ' ' << c[i] << b[i];
        }
    }
    if(isstable(n, c1, c)){
        cout << endl << "Stable" << endl;
    }
    else{
        cout << endl << "Not stable" << endl;
    }
}



Compiler output:
a.cc:6:27: error: use of parameter outside function body before ']' token
    6 | int bubble(int n, char a[n], int b[n]){
      |                           ^
a.cc:6:28: error: expected ')' before ',' token
    6 | int bubble(int n, char a[n], int b[n]){
      |           ~                ^
      |                            )
a.cc:6:30: error: expected unqualified-id before 'int'
    6 | int bubble(int n, char a[n], int b[n]){
      |                              ^~~
a.cc:17:30: error: use of parameter outside function body before ']' token
   17 | int selection(int n, char a[n], int b[n]){
      |                              ^
a.cc:17:31: error: expected ')' before ',' token
   17 | int selection(int n, char a[n], int b[n]){
      |              ~                ^
      |                               )
a.cc:17:33: error: expected unqualified-id before 'int'
   17 | int selection(int n, char a[n], int b[n]){
      |                                 ^~~
a.cc:39:30: error: use of parameter outside function body before ']' token
   39 | bool isstable(int n, char a[n], char b[n]){
      |                              ^
a.cc:39:31: error: expected ')' before ',' token
   39 | bool isstable(int n, char a[n], char b[n]){
      |              ~                ^
      |                               )
a.cc:39:33: error: expected unqualified-id before 'char'
   39 | bool isstable(int n, char a[n], char b[n]){
      |                                 ^~~~
Language: C++

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

int bubble(int n, char a[], int b[]){
    for(int i = 0; i < n; i++){
        for(int j = n-1; j > 0; j--){
            if(b[j] < b[j-1]){
                swap(b[j], b[j-1]);
                swap(a[j], a[j-1]);
            }
        }
    }
    return 0;
}
int selection(int n, char a[], int b[]){
    int minj;
    for(int i = 0; i < n; i++){
        minj = i;
        for(int j = i+1; j < n; j++){
            if(b[minj] > b[j]){
                minj = j;
            }
        }
        if(minj == i){
            continue;
        }
        else{
            swap(b[i], b[minj]);
            swap(a[i], a[minj]);
        }
        
    }
    

    return 0;
}
bool isstable(int n, char a[n], char b[n]){
    for(int i = 0; i < n; i++){
        if(a[i] != b[i]){
            return false;
        }
    }
    return true;
}
int main(void){
    int n;
    cin >> n;
    int b[n]; 
    int b1[n];
    char c[n];
    for(int i = 0; i < n; i++){
        cin >> c[i] >> b[i];
    }
    char c1[n];
    for(int i = 0; i < n; i++){
        c1[i] = c[i];
        b1[i] = b[i];

    }
    
    bubble(n, c1, b1);
    selection(n, c, b);
    
    for(int i = 0; i < n; i++){
        if(i == 0){
            cout << c1[i] << b1[i];
        }
        else{
            cout << ' ' << c1[i] << b1[i];
        }
    }
    cout << endl << "Stable" << endl;
    for(int i = 0; i < n; i++){
        if(i == 0){
            cout << c[i] << b[i];
        }
        else{
            cout << ' ' << c[i] << b[i];
        }
    }
    if(isstable(n, c1, c)){
        cout << endl << "Stable" << endl;
    }
    else{
        cout << endl << "Not stable" << endl;
    }
}



Compiler output:
a.cc:38:30: error: use of parameter outside function body before ']' token
   38 | bool isstable(int n, char a[n], char b[n]){
      |                              ^
a.cc:38:31: error: expected ')' before ',' token
   38 | bool isstable(int n, char a[n], char b[n]){
      |              ~                ^
      |                               )
a.cc:38:33: error: expected unqualified-id before 'char'
   38 | bool isstable(int n, char a[n], char b[n]){
      |                                 ^~~~
Language: C++

#include<iostream>

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) {
			std::cout << " ";
			std::cout << A[i].suit << A[i].value;
		}
	}
	std::cout << std::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;

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

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

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

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

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:63:14: error: 'print' is not a member of 'std'; did you mean 'printf'?
   63 |         std::print(C1, N);
      |              ^~~~~
      |              printf
a.cc:65:14: error: 'print' is not a member of 'std'; did you mean 'printf'?
   65 |         std::print(C2, N);
      |              ^~~~~
      |              printf
Language: C++

#include<iostream>
using namespace std;

struct Stable {
	int Number;
	char Mark;
};

void BubbleSort(Stable* Line, int N) {
	for (int i = 0; i < N; ++i) {
		for (int j = N - 1; j > i; --j) {
			if (Line[j].Number < Line[j - 1].Number) {
				int Case = Line[j].Number;
				Line[j].Number = Line[j - 1].Number;
				Line[j - 1].Number = Case;

				char C = Line[j].Mark;
				Line[j].Mark = Line[j - 1].Mark;
				Line[j - 1].Mark = C;
			}
		}
	}
}

void SelectionSort(Stable* Line, int N) {
	for (int i = 0; i < N; ++i) {
		int minj = i;
		for (int j = i; j < N; ++j) {
			if (Line[j].Number < Line[minj].Number) {
				minj = j;
			}

			
		}
		int Case = Line[i].Number;
		Line[i].Number = Line[minj].Number;
		Line[minj].Number = Case;

		char C = Line[i].Mark;
		Line[i].Mark = Line[minj].Mark;
		Line[minj].Mark = C;
	}
}

void Show(Stable* Line, int N) {
	for (int i = 0; i < N; ++i) {
		if (i > 0) {
			cout << ' ';
		}
		cout << Line[i].Mark << Line[i].Number;
	}
	cout << endl;
}

bool Check(Stable* LineS, Stable* LineB,int N) {
	for (int i = 0; i < N; ++i) {
		if (LineS[i].Mark != LineB[i].Mark) { return false; }
	}
	return true;
}

int main() {
	int N;
	cin >> N;

	Stable* LineB = new Stable[N];
	Stable* LineS = new Stable[N];

	for (int i = 0; i < N; ++i) {
		cin >> LineB[i].Mark >> LineB[i].Number;

		
		LineS[i].Mark = LineB[i].Mark;
		LineS[i].Number = LineB[i].Number;
	}

	BubbleSort(LineB, N);
	SelectionSort(LineS, N);
	
　　　　Show(LineB, N);
	cout << "Stable" << endl;
	
	

	Show(LineS, N);
	if (Check(LineS, LineB, N)) {
		cout << "Stable" << endl;
	}
	else {
		cout << "Not Stable" << endl;
	}



	
}


Compiler output:
a.cc:80:1: error: extended character 　 is not valid in an identifier
   80 | 　　　　Show(LineB, N);
      | ^
a.cc:80:1: error: extended character 　 is not valid in an identifier
a.cc:80:1: error: extended character 　 is not valid in an identifier
a.cc:80:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:80:1: error: '\U00003000\U00003000\U00003000\U00003000Show' was not declared in this scope
   80 | 　　　　Show(LineB, N);
      | ^~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

struct Stable {
	int Number;
	char Mark;
};

void BubbleSort(Stable* Line, int N) {
	for (int i = 0; i < N; ++i) {
		for (int j = N - 1; j > i; --j) {
			if (Line[j].Number < Line[j - 1].Number) {
				int Case = Line[j].Number;
				Line[j].Number = Line[j - 1].Number;
				Line[j - 1].Number = Case;

				char C = Line[j].Mark;
				Line[j].Mark = Line[j - 1].Mark;
				Line[j - 1].Mark = C;
			}
		}
	}
}

void SelectionSort(Stable* Line, int N) {
	for (int i = 0; i < N; ++i) {
		int minj = i;
		for (int j = i; j < N; ++j) {
			if (Line[j].Number < Line[minj].Number) {
				minj = j;
			}

			
		}
		int Case = Line[i].Number;
		Line[i].Number = Line[minj].Number;
		Line[minj].Number = Case;

		char C = Line[i].Mark;
		Line[i].Mark = Line[minj].Mark;
		Line[minj].Mark = C;
	}
}

void Show(Stable* Line, int N) {
	for (int i = 0; i < N; ++i) {
		if (i > 0) {
			cout << ' ';
		}
		cout << Line[i].Mark << Line[i].Number;
	}
	cout << endl;
}

bool Check(Stable* LineS, Stable* LineB,int N) {
	for (int i = 0; i < N; ++i) {
		if (LineS[i].Mark != LineB[i].Mark) { return false; }
	}
	return true;
}

int main() {
	int N;
	cin >> N;

	Stable* LineB = new Stable[N];
	Stable* LineS = new Stable[N];

	for (int i = 0; i < N; ++i) {
		cin >> LineB[i].Mark >> LineB[i].Number;

		
		LineS[i].Mark = LineB[i].Mark;
		LineS[i].Number = LineB[i].Number;
	}

	BubbleSort(LineB, N);
	SelectionSort(LineS, N);
	
　　　　Show(LineB, N);
	cout << "Stable" << endl;
	
	

	Show(LineS, N);
	if (Check(LineS, LineB, N)) {
		cout << "Stable" << endl;
	}
	else {
		cout << "Not Stable" << endl;
	}



	delete[] LineB;
	delete[] LineS;
}


Compiler output:
a.cc:80:1: error: extended character 　 is not valid in an identifier
   80 | 　　　　Show(LineB, N);
      | ^
a.cc:80:1: error: extended character 　 is not valid in an identifier
a.cc:80:1: error: extended character 　 is not valid in an identifier
a.cc:80:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:80:1: error: '\U00003000\U00003000\U00003000\U00003000Show' was not declared in this scope
   80 | 　　　　Show(LineB, N);
      | ^~~~~~~~~~~~