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);
selections(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;
}#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);
selections(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:85:2: error: stray '#' in program
   85 | }#include<stdio.h>
      |  ^
main.c:85:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   85 | }#include<stdio.h>
      |          ^
main.c:97:6: error: redefinition of 'bubble'
   97 | void bubble(struct Number A[],int N){
      |      ^~~~~~
main.c:13:6: note: previous definition of 'bubble' with type 'void(struct Number *, int)'
   13 | void bubble(struct Number A[],int N){
      |      ^~~~~~
main.c:111:6: error: redefinition of 'selections'
  111 | void selections(struct Number A[],int N){
      |      ^~~~~~~~~~
main.c:27:6: note: previous definition of 'selections' with type 'void(struct Number *, int)'
   27 | void selections(struct Number A[],int N){
      |      ^~~~~~~~~~
main.c:125:6: error: redefinition of 'print'
  125 | void print(struct Number A[],int N){
      |      ^~~~~
main.c:41:6: note: previous definition of 'print' with type 'void(struct Number *, int)'
   41 | void print(struct Number A[],int N){
      |      ^~~~~
main.c:134:5: error: redefinition of 'isStable'
  134 | int isStable(struct Number N1[],struct Number N2[],int N){
      |     ^~~~~~~~
main.c:50:5: note: previous definition of 'isStable' with type 'int(struct Number *, struct Number *, int)'
   50 | int isStable(struct Number N1[],struct Number N2[],int N){
      |     ^~~~~~~~
main.c:144:5: error: redefinition of 'main'
  144 | int main(){
      |     ^~~~
main.c:60:5: note: previous definition of 'main' with type 'int()'
   60 | int main(){
      |     ^~~~