Language: C

#include<stdio.h>
#include<string.h>
int i,j;

typedef struct{
 char design;
  char number;
}Card;

void bubble(Card A[],int n){
  Card t;
  for(i=0;i<n;i++){
    for(j=n-1;j>=i+1;j--){
      if(A[j].number<A[j-1].number){
	t=A[j];
	A[j]=A[j-1];
	A[j-1]=t;
      }
    }
  }
}
void select(Card A[],int n){
  int min;
  Card t;
  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(A[j].number<A[min].number)min=j;//????°??????¨??????????´???°  
    }
    t=A[i];
    A[i]=A[min];
    A[min]=t;
  }
}

int stable(Card c1[],Card c2[],int n){
  for(i=0;i<n;i++){
    if(c1[i].design!=c2[i].design)return -1;
  }

  return 1;
  
}

void print(Card A[],int n){

  for(i=0;i<n;i++){
    printf("%c%c",A[i].design,A[i].number);
    if(i!=n-1)printf(" ");
  }
      printf("\n");
}

int main(){
  int n;
  int i;
  Card c1[100],c2[100];
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf(" %c%c", &c1[i].design, &c1[i].number);
    c2[i].design=c1[i].design;
    c2[i].number=c1[i].number;
  }
#include<stdio.h>
#include<string.h>
int i,j;

typedef struct{
 char design;
  char number;
}Card;

void bubble(Card A[],int n){
  Card t;
  for(i=0;i<n;i++){
    for(j=n-1;j>=i+1;j--){
      if(A[j].number<A[j-1].number){
	t=A[j];
	A[j]=A[j-1];
	A[j-1]=t;
      }
    }
  }
}
void select(Card A[],int n){
  int min;
  Card t;
  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(A[j].number<A[min].number)min=j;//????°??????¨??????????´???°  
    }
    t=A[i];
    A[i]=A[min];
    A[min]=t;
  }
}

int stable(Card c1[],Card c2[],int n){
  for(i=0;i<n;i++){
    if(c1[i].design!=c2[i].design)return -1;
  }

  return 1;
  
}

void print(Card A[],int n){

  for(i=0;i<n;i++){
    printf("%c%c",A[i].design,A[i].number);
    if(i!=n-1)printf(" ");
  }
      printf("\n");
}

int main(){
  int n;
  int i;
  Card c1[100],c2[100];
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf(" %c%c", &c1[i].design, &c1[i].number);
    c2[i].design=c1[i].design;
    c2[i].number=c1[i].number;
  }

  bubble(c1,n);
  select(c2,n);

  print(c1,n);
  printf("Stable\n");
  print(c2,n);

  if(stable(c1,c2,n)==1)printf("Stable\n");
  else printf("Not stable\n");
  return 0;
}



  

  

  bubble(c1,n);
  select(c2,n);

  print(c1,n);
  printf("Stable\n");
  print(c2,n);

  if(stable(c1,c2,n)==1)printf("Stable\n");
  else printf("Not stable\n");
  return 0;
}



  

  

Compiler output:
main.c: In function 'main':
main.c:67:5: error: redeclaration of 'i' with no linkage
   67 | int i,j;
      |     ^
main.c:56:7: note: previous declaration of 'i' with type 'int'
   56 |   int i;
      |       ^
main.c:148:10: error: passing argument 1 of 'bubble' from incompatible pointer type [-Wincompatible-pointer-types]
  148 |   bubble(c1,n);
      |          ^~
      |          |
      |          Card *
main.c:74:18: note: expected 'Card *' but argument is of type 'Card *'
   74 | void bubble(Card A[],int n){
      |             ~~~~~^~~
main.c:149:10: error: passing argument 1 of 'select' from incompatible pointer type [-Wincompatible-pointer-types]
  149 |   select(c2,n);
      |          ^~
      |          |
      |          Card *
main.c:86:18: note: expected 'Card *' but argument is of type 'Card *'
   86 | void select(Card A[],int n){
      |             ~~~~~^~~
main.c:151:9: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
  151 |   print(c1,n);
      |         ^~
      |         |
      |         Card *
main.c:109:17: note: expected 'Card *' but argument is of type 'Card *'
  109 | void print(Card A[],int n){
      |            ~~~~~^~~
main.c:153:9: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
  153 |   print(c2,n);
      |         ^~
      |         |
      |         Card *
main.c:109:17: note: expected 'Card *' but argument is of type 'Card *'
  109 | void print(Card A[],int n){
      |            ~~~~~^~~
main.c:155:13: error: passing argument 1 of 'stable' from incompatible pointer type [-Wincompatible-pointer-types]
  155 |   if(stable(c1,c2,n)==1)printf("Stable\n");
      |             ^~
      |             |
      |             Card *
main.c:100:17: note: expected 'Card *' but argument is of type 'Card *'
  100 | int stable(Card c1[],Card c2[],int n){
      |            ~~~~~^~~~
main.c:155:16: error: passing argument 2 of 'stable' from incompatible pointer type [-Wincompatible-pointer-types]
  155 |   if(stable(c1,c2,n)==1)printf("Stable\n");
      |                ^~
      |                |
      |                Card *
main.c:100:27: note: expected 'Card *' but argument is of type 'Card *'
  100 | int stable(Card c1[],Card c2[],int n){
      |                      ~~~~~^~~~