Language: C

#include<stdio.h>
 
 struct card{
           char gara;
           int kazu;
           };

 struct card card1[37];
 struct card card2[37];

 void bublle(struct card card1[],int n){
               int i,j;
               struct card t;
               for(i=0;i<n;i++){
                          for(j=n;j>i;j--){
                                   if(card1[j-1].kazu>card1[j].kazu){
                                                   tmp=card1[j-1].kazu;
                                                   card1[j-1].kazu=card1[j].kazu;
                                                   card1[j].kazu=tmp;
                                                   }
                                   }
                          }
               return 0;
               }

 void select(struct card card2[],int n){
           int i,j,min;
           struct card tmp;
           for(i=0;i<n;i++){
                     min=i;
                     for(j=i;j<n;j++){
                              if(card2[j].kazu<card2[min].kazu){
                                                        min=j;
                                                        }
                              }
                     if(min!=i){
                              tmp=card2[j-1].kazu;
                              card2[j-1].kazu=card2[j].kazu;
                              card2[j].kazu=tmp;
                                 }
            return 0;
            }
 
 int main(){
         int i,j,n,x,flag;
         char c;
         scanf("%d",&n);
         for(i=0;i<n;i++){
                    scanf("%c%d",&c,&x);
                    card1[i].gara=c;
                    card2[i].gara=card1[i].gara;
                    card1[i].kazu=x;
                    card2[i].kazu=card1[i].kazu;
                    }

         bublle(card1,n);
         for(i=0;i<n;i++){
                   printf("%c%d%c",card1[i].gara,card1[i].kazu,(i==n-1)?'\n':' ');
                   }
         printf("Stable\n");
         select(card2,n);
         for(i=0;i<n;i++){
                   printf("%c%d%c",card2[i].gara,card2[i].kazu,(i==n-1)?'\n':' ');
                   }
         flag=1;
         for(i=0;i<n;i++){
                  if(card2[i].gara!=card1[i].gara){flag=0;break;}
                  }
         if(flag==1)printf("Stable\n");
         else printf("Not stable\n");

         return 0;
         }








Compiler output:
main.c: In function 'bublle':
main.c:17:52: error: 'tmp' undeclared (first use in this function)
   17 |                                                    tmp=card1[j-1].kazu;
      |                                                    ^~~
main.c:17:52: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:23: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   23 |                return 0;
      |                       ^
main.c:11:7: note: declared here
   11 |  void bublle(struct card card1[],int n){
      |       ^~~~~~
main.c: In function 'select':
main.c:37:35: error: incompatible types when assigning to type 'struct card' from type 'int'
   37 |                               tmp=card2[j-1].kazu;
      |                                   ^~~~~
main.c:39:45: error: incompatible types when assigning to type 'int' from type 'struct card'
   39 |                               card2[j].kazu=tmp;
      |                                             ^~~
main.c:41:20: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   41 |             return 0;
      |                    ^
main.c:26:7: note: declared here
   26 |  void select(struct card card2[],int n){
      |       ^~~~~~
main.c:73:10: error: expected declaration or statement at end of input
   73 |          }
      |          ^