Language: C

#include<stdio.h>

typedef struct{
  int value[36];
  char mark[36];
} Card;

void judge(char *, char *, int);
void bubble(Card, char *, int);
void select(Card, char *, int);

int main(){
  int i, j, k, n, cnt=0;
  Card card;

  scanf("%d", &n);
  char pair[n] = {0};
  for(i=0; i<n; i++){
    scanf("%*c%c%d", &card.mark[i], &card.value[i]);
  }

  for(i=0; i<n; i++){
    for(j=i+1; j<n; j++){
      if(card.value [i] == card.value[j]){
	pair[cnt] = card.mark[i];
	pair[++cnt] = card.mark[j];
	cnt++;
      }
    }
  }

  bubble(card, pair, n);
  select(card, pair, n);
  
  return 0;
}


void judge(char *pair1, char *pair2, int n){
  char cmp[n] = {0};
  if(strcmp(pair1, pair2) == 0
     || strcmp(cmp, pair) == 0) printf("Stable\n");
  else printf("Not stable\n");
}

void bubble(Card card, char *pair1, int n){
  int i, j, tmp, cnt=0;
  char pair2[n]=0;
  for(i=0; i<n; i++){ //バブル
    for(j=n-1; j>i; j--){
      if(card.value[j] < card.value[j-1]){
	tmp = card.value[j];
	card.value[j] = card.value[j-1];
	card.value[j-1] = tmp;
	
	tmp = card.mark[j];
	card.mark[j] = card.mark[j-1];
	card.mark[j-1] = tmp;
      }
    }
  }

  for(i=0; i<n-1; i++){
    printf("%c%d ", card.mark[i], card.value[i]);
  } printf("%c%d\n", card.mark[i], card.value[i]);
  
  for(i=0; i<n; i++){
    for(j=i+1; j<n; j++){
      if(card.value [i] == card.value[j]){
	pair2[cnt] = card.mark[i];
	pair2[++cnt] = card.mark[j];
	cnt++;
      }
    }
  }

  judge(pair1, pair2, n);
}

void select(Card card, char *pair, int n){
  int i, j, minJ, tmp, cnt;
  char pair2[n]=0;
  for(i=0; i<n; i++){
    minJ = i;
    for(j=i; j<n; j++){
      if(card.value[j] < card.value[minJ]){
	minJ = j;
      }
    }
    if(minJ != i){
      tmp = card.value[i];
      card.value[i] = card.value[minJ];
      card.value[minJ] = tmp;

      tmp = card.mark[i];
      card.mark[i] = card.mark[minJ];
      card.mark[minJ] = tmp;
    }
  }
  for(i=0; i<n-1; i++){
    printf("%c%d ", card.mark[i], card.value[i]);
  } printf("%c%d\n", card.mark[i], card.value[i]);

  for(i=0; i<n; i++){
    for(j=i+1; j<n; j++){
      if(card.value [i] == card.value[j]){
	pair2[cnt] = card.mark[i];
	pair2[++cnt] = card.mark[j];
	cnt++;
      }
    }
  }

  judge(pair, n);
}



Compiler output:
main.c: In function 'main':
main.c:17:18: error: variable-sized object may not be initialized except with an empty initializer
   17 |   char pair[n] = {0};
      |                  ^
main.c: In function 'judge':
main.c:40:17: error: variable-sized object may not be initialized except with an empty initializer
   40 |   char cmp[n] = {0};
      |                 ^
main.c:41:6: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   41 |   if(strcmp(pair1, pair2) == 0
      |      ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:42:21: error: 'pair' undeclared (first use in this function); did you mean 'pair2'?
   42 |      || strcmp(cmp, pair) == 0) printf("Stable\n");
      |                     ^~~~
      |                     pair2
main.c:42:21: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'bubble':
main.c:48:17: error: variable-sized object may not be initialized except with an empty initializer
   48 |   char pair2[n]=0;
      |                 ^
main.c: In function 'select':
main.c:82:17: error: variable-sized object may not be initialized except with an empty initializer
   82 |   char pair2[n]=0;
      |                 ^
main.c:114:15: error: passing argument 2 of 'judge' makes pointer from integer without a cast [-Wint-conversion]
  114 |   judge(pair, n);
      |               ^
      |               |
      |               int
main.c:39:31: note: expected 'char *' but argument is of type 'int'
   39 | void judge(char *pair1, char *pair2, int n){
      |                         ~~~~~~^~~~~
main.c:114:3: error: too few arguments to function 'judge'
  114 |   judge(pair, n);
      |   ^~~~~
main.c:39:6: note: declared here
   39 | void judge(char *pair1, char *pair2, int n){
      |      ^~~~~