Language: C

#include <stdio.h>

void change(int n,int m,char s,char t)
{
 int l;
 char r;

 l=n;
 n=m;
 m=l;

 r=s;
 s=t;
 t=r;

}

void print(int a[],int N)
{
 int i;

 for(i=0;i<N-1;i++){
  printf("%c%d ",a[i].mark,a[i].num);
 }
 printf("%c%d\n",a[N-1].mark,a[N-1].num);

}

struct card {
    char mark[1];
    int  num;
};

int main(void)
{
 int N,i,j,k,l,min;
 struct card a[36],b[36];

 scanf("%d",&N);

 for(i=0;i<N;i++){
  scanf("%c%d",&a[i].mark,a[i].num);
 }

 for(i=0;i<N-1;i++){
  for(j=N-1;j<i+1;j--){
   if(a[j].num<a[j-1].num){
     change(a[j].num,a[j-1].num,a[j].mark,a[j-1].mark);
   }
  }
 }

 for(i=0;i<N;i++){
  b[i]=a[i];
 }

 print(a,N);
 printf("Stable\n");

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

  min=i;
  for(j=i;j<N;j++){

   if(a[j]<a[min]){
    min=j;
   }
   change(a[i].num,a[min].num,a[i].mark,a[min].mark);

  }
 }

 print(a,N);
 for(i=0;i<N;i++){
  if(a[i].num==b[i].num&&a[i].mark!=b[i]){
   printf("Not stable\n");
  }else{
   printf("Stable\n");
  }
 }

 return 0;

}

Compiler output:
main.c: In function 'print':
main.c:23:22: error: request for member 'mark' in something not a structure or union
   23 |   printf("%c%d ",a[i].mark,a[i].num);
      |                      ^
main.c:23:32: error: request for member 'num' in something not a structure or union
   23 |   printf("%c%d ",a[i].mark,a[i].num);
      |                                ^
main.c:25:24: error: request for member 'mark' in something not a structure or union
   25 |  printf("%c%d\n",a[N-1].mark,a[N-1].num);
      |                        ^
main.c:25:36: error: request for member 'num' in something not a structure or union
   25 |  printf("%c%d\n",a[N-1].mark,a[N-1].num);
      |                                    ^
main.c: In function 'main':
main.c:48:37: error: passing argument 3 of 'change' makes integer from pointer without a cast [-Wint-conversion]
   48 |      change(a[j].num,a[j-1].num,a[j].mark,a[j-1].mark);
      |                                 ~~~~^~~~~
      |                                     |
      |                                     char *
main.c:3:30: note: expected 'char' but argument is of type 'char *'
    3 | void change(int n,int m,char s,char t)
      |                         ~~~~~^
main.c:48:49: error: passing argument 4 of 'change' makes integer from pointer without a cast [-Wint-conversion]
   48 |      change(a[j].num,a[j-1].num,a[j].mark,a[j-1].mark);
      |                                           ~~~~~~^~~~~
      |                                                 |
      |                                                 char *
main.c:3:37: note: expected 'char' but argument is of type 'char *'
    3 | void change(int n,int m,char s,char t)
      |                                ~~~~~^
main.c:57:8: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
   57 |  print(a,N);
      |        ^
      |        |
      |        struct card *
main.c:18:16: note: expected 'int *' but argument is of type 'struct card *'
   18 | void print(int a[],int N)
      |            ~~~~^~~
main.c:65:11: error: invalid operands to binary < (have 'struct card' and 'struct card')
   65 |    if(a[j]<a[min]){
      |       ~~~~^~~~~~~
      |        |    |
      |        |    struct card
      |        struct card
main.c:68:35: error: passing argument 3 of 'change' makes integer from pointer without a cast [-Wint-conversion]
   68 |    change(a[i].num,a[min].num,a[i].mark,a[min].mark);
      |                               ~~~~^~~~~
      |                                   |
      |                                   char *
main.c:3:30: note: expected 'char' but argument is of type 'char *'
    3 | void change(int n,int m,char s,char t)
      |                         ~~~~~^
main.c:68:47: error: passing argument 4 of 'change' makes integer from pointer without a cast [-Wint-conversion]
   68 |    change(a[i].num,a[min].num,a[i].mark,a[min].mark);
      |                                         ~~~~~~^~~~~
      |                                               |
      |                                               char *
main.c:3:37: note: expected 'char' but argument is of type 'char *'
    3 | void change(int n,int m,char s,char t)
      |                                ~~~~~^
main.c:73:8: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
   73 |  print(a,N);
      |        ^
      |        |
      |        struct card *
main.c:18:16: note: expected 'int *' but argument is of type 'struct card *'
   18 | void print(int a[],int N)
      |            ~~~~^~~
main.c:75:35: error: invalid operands to binary != (have 'char *' and 'struct card')
   75 |   if(a[i].num==b[i].num&&a[i].mark!=b[i]){
      |                        ~~         ^~~~~~
      |                        |             |
      |                        char *        struct card