Language: C

#include <stdio.h>

typedef 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; j--){
      if(A[j].value < A[j-1].value){
        struct 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;
    }
    struct 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) printf(" ");
    printf("%c",A[i].suit);
    printf("%d",A[i].value);
  }
  printf("\n");
}

int 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 1;
  }
  return 0;
}

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

  scanf("%d",&N);

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

  for(int i; 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)){
    printf("Stable\n");
  }
  else {
    printf("Not suitable\n");
  }

  return 0;

}



Compiler output:
main.c:5:1: warning: useless storage class specifier in empty declaration
    5 | };
      | ^
main.c: In function 'main':
main.c:58:21: error: request for member 'suit' in something not a structure or union
   58 |     scanf("%c",C1[i].suit);
      |                     ^
main.c:59:21: error: request for member 'value' in something not a structure or union
   59 |     scanf("%d",C1[i].value);
      |                     ^
main.c:64:10: error: passing argument 1 of 'bubble' from incompatible pointer type [-Wincompatible-pointer-types]
   64 |   bubble(C1,N);
      |          ^~
      |          |
      |          int *
main.c:7:25: note: expected 'struct Card *' but argument is of type 'int *'
    7 | void bubble(struct Card A[], int N){
      |             ~~~~~~~~~~~~^~~
main.c:65:13: error: passing argument 1 of 'selection' from incompatible pointer type [-Wincompatible-pointer-types]
   65 |   selection(C2,N);
      |             ^~
      |             |
      |             int *
main.c:20:28: note: expected 'struct Card *' but argument is of type 'int *'
   20 | void selection(struct Card A[], int N){
      |                ~~~~~~~~~~~~^~~
main.c:67:9: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
   67 |   print(C1,N);
      |         ^~
      |         |
      |         int *
main.c:33:24: note: expected 'struct Card *' but argument is of type 'int *'
   33 | void print(struct Card A[],int N){
      |            ~~~~~~~~~~~~^~~
main.c:70:9: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
   70 |   print(C2,N);
      |         ^~
      |         |
      |         int *
main.c:33:24: note: expected 'struct Card *' but argument is of type 'int *'
   33 | void print(struct Card A[],int N){
      |            ~~~~~~~~~~~~^~~
main.c:71:15: error: passing argument 1 of 'isStable' from incompatible pointer type [-Wincompatible-pointer-types]
   71 |   if(isStable(C1,C2,N)){
      |               ^~
      |               |
      |               int *
main.c:43:26: note: expected 'struct Card *' but argument is of type 'int *'
   43 | int isStable(struct Card C1[], struct Card C2[], int N){
      |              ~~~~~~~~~~~~^~~~
main.c:71:18: error: passing argument 2 of 'isStable' from incompatible pointer type [-Wincompatible-pointer-types]
   71 |   if(isStable(C1,C2,N)){
      |                  ^~
      |                  |
      |                  int *
main.c:43:44: note: expected 'struct Card *' but argument is of type 'int *'
   43 | int isStable(struct Card C1[], struct Card C2[], int N){
      |                                ~~~~~~~~~~~~^~~~