Language: C

#include <stdio.h>
 
typedef struct{
  char suit;
  char value;
} Card;

void Bubble(Card *, int);
void Selection(Card *, int);
int TorF(Card *, Card *, int);
void Print(Card *, int);

int main()
{
  int n, i;
  Card c1[100], c2[100];
 
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf(" %c%c",&c1[i].suit,&c1[i].value);
    c2[i] = c1[i];
  }
 
  Bubble(c1, n);
  Selection(c2, n);
 
  Print(c1, n);
  printf("Stable\n");
  Print(c2, n);
  if(TorF(c1, c2, n) == n) printf("Stable\n");
  else printf("Not stable\n");
   
  return 0;
}

void Bubble(Card *X, int n)
{
  int i, j;
  Card card1;
  for(i = 0; i < n; i++){
    for(j = n-1; j >= i; j--){
      if(X[j].value < X[j-1].value){
    card1 = X[j];
    X[j] = X[j-1];
    X[j-1] = card1;
      }
    }
  }
}
 
void Selection(Card *X, int n)
{
  int i, j, k;
  Card card2;
  for(i = 0; i < n; i++){
    k = i;
    for(j = i; j < n; j++) if(X[j].value < X[k].value) k = j;
    card2 = X[i];
    X[i] = X[k];
    X[k] = card2;
  }
}
 
int TorF(Card *X, Card *Y, int n)
{
  int i, count=0;
  for(i = 0; i < n; i++) if(X[i].suit == Y[i].suit) count++;
  return count;
}
 
void Print(Card *X, int n)
{
  int i;
  for(i = 0; i < n; i++){
    if(i != n-1) printf("%c%c ", X[i].suit, X[i].value);
    else printf("%c%c", X[i].suit, X[i].value);
  }
  printf("\n");
}

typedef struct{
  char suiinclude <stdio.h>
 
typedef struct{
  char suit;
  char value;
} Card;

void Bubble(Card *, int);
void Selection(Card *, int);
int TorF(Card *, Card *, int);
void Print(Card *, int);

int main()
{
  int n, i;
  Card c1[100], c2[100];
 
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf(" %c%c",&c1[i].suit,&c1[i].value);
    c2[i] = c1[i];
  }
 
  Bubble(c1, n);
  Selection(c2, n);
 
  Print(c1, n);
  printf("Stable\n");
  Print(c2, n);
  if(TorF(c1, c2, n) == n) printf("Stable\n");
  else printf("Not stable\n");
   
  return 0;
}

void Bubble(Card *X, int n)
{
  int i, j;
  Card card1;
  for(i = 0; i < n; i++){
    for(j = n-1; j >= i; j--){
      if(X[j].value < X[j-1].value){
    card1 = X[j];
    X[j] = X[j-1];
    X[j-1] = card1;
      }
    }
  }
}
 
void Selection(Card *X, int n)
{
  int i, j, k;
  Card card2;
  for(i = 0; i < n; i++){
    k = i;
    for(j = i; j < n; j++) if(X[j].value < X[k].value) k = j;
    card2 = X[i];
    X[i] = X[k];
    X[k] = card2;
  }
}
 
int TorF(Card *X, Card *Y, int n)
{
  int i, count=0;
  for(i = 0; i < n; i++) if(X[i].suit == Y[i].suit) count++;
  return count;
}
 
void Print(Card *X, int n)
{
  int i;
  for(i = 0; i < n; i++){
    if(i != n-1) printf("%c%c ", X[i].suit, X[i].value);
    else printf("%c%c", X[i].suit, X[i].value);
  }
  printf("\n");
}
t;
  char value;
} Card;

void Bubble(Card *, int);
void Selection(Card *, int);
int TorF(Card *, Card *, int);
void Print(Card *, int);

int main()
{
  int n, i;
  Card c1[100], c2[100];
 
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf(" %c%c",&c1[i].suit,&c1[i].value);
    c2[i] = c1[i];
  }
 
  Bubble(c1, n);
  Selection(c2, n);
 
  Print(c1, n);
  printf("Stable\n");
  Print(c2, n);
  if(TorF(c1, c2, n) == n) printf("Stable\n");
  else printf("Not stable\n");
   
  return 0;
}

void Bubble(Card *X, int n)
{
  int i, j;
  Card card1;
  for(i = 0; i < n; i++){
    for(j = n-1; j >= i; j--){
      if(X[j].value < X[j-1].value){
    card1 = X[j];
    X[j] = X[j-1];
    X[j-1] = card1;
      }
    }
  }
}
 
void Selection(Card *X, int n)
{
  int i, j, k;
  Card card2;
  for(i = 0; i < n; i++){
    k = i;
    for(j = i; j < n; j++) if(X[j].value < X[k].value) k = j;
    card2 = X[i];
    X[i] = X[k];
    X[k] = card2;
  }
}
 
int TorF(Card *X, Card *Y, int n)
{
  int i, count=0;
  for(i = 0; i < n; i++) if(X[i].suit == Y[i].suit) count++;
  return count;
}
 
void Print(Card *X, int n)
{
  int i;
  for(i = 0; i < n; i++){
    if(i != n-1) printf("%c%c ", X[i].suit, X[i].value);
    else printf("%c%c", X[i].suit, X[i].value);
  }
  printf("\n");
}

Compiler output:
main.c:82:19: error: expected ':', ',', ';', '}' or '__attribute__' before '<' token
   82 |   char suiinclude <stdio.h>
      |                   ^
main.c:163:3: error: conflicting types for 'Card'; have 'struct <anonymous>'
  163 | } Card;
      |   ^~~~
main.c:6:3: note: previous declaration of 'Card' with type 'Card'
    6 | } Card;
      |   ^~~~
main.c:165:6: error: conflicting types for 'Bubble'; have 'void(Card *, int)'
  165 | void Bubble(Card *, int);
      |      ^~~~~~
main.c:36:6: note: previous definition of 'Bubble' with type 'void(Card *, int)'
   36 | void Bubble(Card *X, int n)
      |      ^~~~~~
main.c:166:6: error: conflicting types for 'Selection'; have 'void(Card *, int)'
  166 | void Selection(Card *, int);
      |      ^~~~~~~~~
main.c:51:6: note: previous definition of 'Selection' with type 'void(Card *, int)'
   51 | void Selection(Card *X, int n)
      |      ^~~~~~~~~
main.c:167:5: error: conflicting types for 'TorF'; have 'int(Card *, Card *, int)'
  167 | int TorF(Card *, Card *, int);
      |     ^~~~
main.c:64:5: note: previous definition of 'TorF' with type 'int(Card *, Card *, int)'
   64 | int TorF(Card *X, Card *Y, int n)
      |     ^~~~
main.c:168:6: error: conflicting types for 'Print'; have 'void(Card *, int)'
  168 | void Print(Card *, int);
      |      ^~~~~
main.c:71:6: note: previous definition of 'Print' with type 'void(Card *, int)'
   71 | void Print(Card *X, int n)
      |      ^~~~~
main.c:170:5: error: redefinition of 'main'
  170 | int main()
      |     ^~~~
main.c:13:5: note: previous definition of 'main' with type 'int()'
   13 | int main()
      |     ^~~~
main.c: In function 'main':
main.c:177:25: error: 'Card' has no member named 'suit'
  177 |     scanf(" %c%c",&c1[i].suit,&c1[i].value);
      |                         ^
main.c:177:37: error: 'Card' has no member named 'value'
  177 |     scanf(" %c%c",&c1[i].suit,&c1[i].value);
      |                                     ^
main.c: At top level:
main.c:193:6: error: conflicting types for 'Bubble'; have 'void(Card *, int)'
  193 | void Bubble(Card *X, int n)
      |      ^~~~~~
main.c:36:6: note: previous definition of 'Bubble' with type 'void(Card *, int)'
   36 | void Bubble(Card *X, int n)
      |      ^~~~~~
main.c: In function 'Bubble':
main.c:199:14: error: 'Card' has no member named 'value'
  199 |       if(X[j].value < X[j-1].value){
      |              ^
main.c:199:29: error: 'Card' has no member named 'value'
  199 |       if(X[j].value < X[j-1].value){
      |                             ^
main.c: At top level:
main.c:208:6: error: conflicting types for 'Selection'; have 'void(Card *, int)'
  208 | void Selection(Card *X, int n)
      |      ^~~~~~~~~
main.c:51:6: note: previous definition of 'Selection' with type 'void(Card *, int)'
   51 | void Selection(Card *X, int n)
      |      ^~~~~~~~~
main.c: In function 'Selection':
main.c:214:35: error: 'Card' has no member named 'value'
  214 |     for(j = i; j < n; j++) if(X[j].value < X[k].value) k = j;
      |                                   ^
main.c:214:48: error: 'Card' has no member named 'value'
  214 |     for(j = i; j < n; j++) if(X[j].value < X[k].value) k = j;
      |                                                ^
main.c: At top level:
main.c:221:5: error: conflicting types for 'TorF'; have 'int(Card *, Card *, int)'
  221 | int TorF(Card *X, Card *Y, int n)
      |     ^~~~
main.c:64:5: note: previous definition of 'TorF' with type 'int(Card *, Card *, int)'
   64 | int TorF(Card *X, Card *Y, int n)
      |     ^~~~
main.c: In function 'TorF':
main.c:224:33: error: 'Card' has no member named 'suit'
  224 |   for(i = 0; i < n; i++) if(X[i].suit == Y[i].suit) count++;
      |                                 ^
main.c:224:46: error: 'Card' has no member named 'suit'
  224 |   for(i = 0; i < n; i++) if(X[i].suit == Y[i].suit) count++;
      |                                              ^
main.c: At top level:
main.c:228:6: error: conflicting types for 'Print'; have 'void(Card *, int)'
  228 | void Print(Card *X, int n)
      |      ^~~~~
main.c:71:6: note: previous definition of 'Print' with type 'void(Card *, int)'
   71 | void Print(Card *X, int n)
      |      ^~~~~
main.c: In function 'Print':
main.c:232:38: error: 'Card' has no member named 'suit'
  232 |     if(i != n-1) printf("%c%c ", X[i].suit, X[i].value);
      |                                      ^
main.c:232:49: error: 'Card' has no member named 'value'
  232 |     if(i != n-1) printf("%c%c ", X[i].suit, X[i].value);
      |                                                 ^
main.c:233:29: error: 'Card' has no member named 'suit'
  233 |     else printf("%c%c", X[i].suit, X[i].value);
      |                             ^
main.c:233:40: error: 'Card' has no member named 'value'
  233 |     else printf("%c%c", X[i].suit, X[i].value);
      |                                        ^