Language: C

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

struct Tr{
  int id;
  char value[2];
};

int main(){

  int N,i,j,minj,M=1;
  struct Tr *C, *C2,K;

  scanf("%d",&N);

  C = (struct Tr *)malloc(sizeof(struct Tr) * N);
  C2 = (struct Tr *)malloc(sizeof(struct Tr) * N);

  for(i=0; i<=N-1; i++){
    scanf("%s",&C[i].value);
    C[i].id = i;
    C2[i] = C[i];
  }
  //BubbleSort(C2, N)
  for(i=0; i<=N-1; i++){
    for(j=N-1; j>=i+1; j--){
      if(C2[j].value[1] < C2[j-1].value[1]){
        K = C2[j];
        C2[j] = C2[j-1];
        C2[j-1] = K;
      }
    }
  }


  //SelectionSort(C, N)

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

  printf("%s",C2[0].value);
  for(i=1; i<=N-1; i++){
    printf(" %s",C2[i].value);
  }
  for(i=1; i<=N-1; i++){
    if(C[i].value[1] == C[i-1].value[1]){
      if(C[i].id < C[i-1].id)
        M = 0;
      break;
      else M = 1;
    }
  }
  if(M == 1) printf("\nStable\n");
  else if(M == 0) printf("\nNot stable\n");

  printf("%s",C[0].value);
  for(i=1; i<=N-1; i++){
    printf(" %s",C[i].value);
  }
  for(i=1; i<=N-1; i++){
    if(C[i].value[1] == C[i-1].value[1]){
      if(C[i].id < C[i-1].id)
        M = 0;
      break;
      else M = 1;
    }
  }
  if(M == 1) printf("\nStable\n");
  else if(M == 0) printf("\nNot stable\n");
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:58:7: error: expected '}' before 'else'
   58 |       else M = 1;
      |       ^~~~
main.c: At top level:
main.c:61:3: error: expected identifier or '(' before 'if'
   61 |   if(M == 1) printf("\nStable\n");
      |   ^~
main.c:62:3: error: expected identifier or '(' before 'else'
   62 |   else if(M == 0) printf("\nNot stable\n");
      |   ^~~~
main.c:64:10: error: expected declaration specifiers or '...' before string constant
   64 |   printf("%s",C[0].value);
      |          ^~~~
main.c:64:15: error: unknown type name 'C'
   64 |   printf("%s",C[0].value);
      |               ^
main.c:65:3: error: expected identifier or '(' before 'for'
   65 |   for(i=1; i<=N-1; i++){
      |   ^~~
main.c:65:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   65 |   for(i=1; i<=N-1; i++){
      |             ^~
main.c:65:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   65 |   for(i=1; i<=N-1; i++){
      |                     ^~
main.c:68:3: error: expected identifier or '(' before 'for'
   68 |   for(i=1; i<=N-1; i++){
      |   ^~~
main.c:68:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   68 |   for(i=1; i<=N-1; i++){
      |             ^~
main.c:68:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   68 |   for(i=1; i<=N-1; i++){
      |                     ^~
main.c:76:3: error: expected identifier or '(' before 'if'
   76 |   if(M == 1) printf("\nStable\n");
      |   ^~
main.c:77:3: error: expected identifier or '(' before 'else'
   77 |   else if(M == 0) printf("\nNot stable\n");
      |   ^~~~
main.c:78:3: error: expected identifier or '(' before 'return'
   78 |   return 0;
      |   ^~~~~~
main.c:79:1: error: expected identifier or '(' before '}' token
   79 | }
      | ^