criyle/codenet-compile-errors huggingface dataset:
Language: C

#include<stdio.h>

struct card{
  char design[100];
  int num;
};

void bubble(struct card a[], int N){
  int i, j, temp;
  int flag = 1;
  char t;
  for (i=0; flag==1; i++) {
    flag = 0;
    for (j=N-1; j>=i+1; j--) {
      if (a[j-1].num > a[j].num) {
        temp       = a[j-1].num; 
        a[j-1].num = a[j].num;
        a[j].num   = temp;
        t            = a[j-1].design;
        a[j-1].design = a[j].design;
        a[j].design   = t;
        flag = 1;
      }
    }
  }
}
void selection(struct card a[], int N){
  int i, j, temp, minj;
  char t;
  for (i=0; i<N; i++) {
    minj = i;
    for (j=i; j<N; j++) {
      if (a[j].num < a[minj].num)
        minj = j;
    }
    temp       = a[j-1].num;
    a[j-1].num = a[j].num;
    a[j].num   = temp;
    t             = a[j-1].design;
    a[j-1].design = a[j].design;
    a[j].design   = t;
  }
}
void print(struct card a[], int N){
  int i;
  for (i=0; i<N; i++) {
    if (i>0)
      putchar(' ');
    printf("%c%d", a[i].design, a[i].num);
  }
  printf("\n");
}
int stable(struct card c1[], struct card c2[], int N){
  int i;
  for (i=0; i<N; i++) {
    if (c1[i].design != c2[i].design)
      return 0;
  }
  return 1;
}

int main(){
  struct card c1[100], c2[100];
  int N, i;

  scanf("%d", &N);
  for (i=0; i<N; i++)
    scanf("%c%d", &c1[i].design, &c1[i].num);

  for (i=0; i<N; i++) {
    c2[i].design = c1[i].design;
    c2[i].num    = c1[i].num;
  }

  bubble(c1, N);
  selection(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 'bubble':
main.c:19:22: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   19 |         t            = a[j-1].design;
      |                      ^
main.c:20:23: error: assignment to expression with array type
   20 |         a[j-1].design = a[j].design;
      |                       ^
main.c:21:23: error: assignment to expression with array type
   21 |         a[j].design   = t;
      |                       ^
main.c: In function 'selection':
main.c:39:19: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   39 |     t             = a[j-1].design;
      |                   ^
main.c:40:19: error: assignment to expression with array type
   40 |     a[j-1].design = a[j].design;
      |                   ^
main.c:41:19: error: assignment to expression with array type
   41 |     a[j].design   = t;
      |                   ^
main.c: In function 'main':
main.c:71:18: error: assignment to expression with array type
   71 |     c2[i].design = c1[i].design;
      |                  ^
Language: C

#include<stdio.h>
 
typedef struct{
  char mark;
  int  num;
} card;
int main()
{
   
  int n, i, j, minj, stable, flag;
  card data[35];
  card data_copy[35];
  card A;
  stable = 1;
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%1s%d", &data[i].mark, &data[i].num);
  }
  
   
  for(i = 0; i < n; i++){
    data_copy[i] = data[i];
  }
   
  //Bubble
  for(i = 0; i < n; i++){
    for(j = n-1; j > i; j--){
      if (data[j].num < data[j-1].num){
        A = data[j];
        data[j] = data[j-1];
        data[j-1] = A;
      }
    }
  }
  
  printf("%c%d", data[0].mark, data[0].num);
  for (i = 1; i < n; i++){
    printf(" %c%d", data[i].mark, data[i].num);
  }
  printf("\n");
  printf("Stable\n");
 
  //Selection
 
  for(i = 0; i < n; i++){
    data[i] = data_copy[i];
  }
  flag = 1;
  flag = 0;
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if(data[j].num < data[minj].num){
        if (data[j].num == data[minj]){
          stable = 0;
        }
        minj = j;
      }
      A = data[i];
      data[i] = data[minj];
      data[minj] = A;
      
    }
  }
  printf("%c%d", data[0].mark, data[0].num);
  for(i = 1; i < n; i++){
    printf(" %c%d", data[i].mark, data[i].num);
  }
  printf("\n");
  if (stable == 1){
    printf("Stable");
  }else{
    printf("Not stable");
  }
  printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:54:25: error: invalid operands to binary == (have 'int' and 'card')
   54 |         if (data[j].num == data[minj]){
      |             ~~~~~~~~~~~ ^~ ~~~~~~~~~~
      |                    |           |
      |                    int         card
Language: C

#include<stdio.h>
 
typedef struct{
  char mark;
  int  num;
} card;
int main()
{
   
  int n, i, j, minj, stable, flag;
  card data[35];
  card data_copy[35];
  card A;
  stable = 1;
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%1s%d", &data[i].mark, &data[i].num);
  }
  
   
  for(i = 0; i < n; i++){
    data_copy[i] = data[i];
  }
   
  //Bubble
  for(i = 0; i < n; i++){
    for(j = n-1; j > i; j--){
      if (data[j].num < data[j-1].num){
        A = data[j];
        data[j] = data[j-1];
        data[j-1] = A;
      }
    }
  }
  
  printf("%c%d", data[0].mark, data[0].num);
  for (i = 1; i < n; i++){
    printf(" %c%d", data[i].mark, data[i].num);
  }
  printf("\n");
  printf("Stable\n");
 
  //Selection
 
  for(i = 0; i < n; i++){
    data[i] = data_copy[i];
  }
  flag = 1;
  flag = 0;
  for(i = 0; i < n; i++){
    minj = i;
    for(j = i; j < n; j++){
      if(data[j].num < data[minj].num){
        if (data[j].num == data[minj],num){
          stable = 0;
        }
        minj = j;
      }
      A = data[i];
      data[i] = data[minj];
      data[minj] = A;
      
    }
  }
  printf("%c%d", data[0].mark, data[0].num);
  for(i = 1; i < n; i++){
    printf(" %c%d", data[i].mark, data[i].num);
  }
  printf("\n");
  if (stable == 1){
    printf("Stable");
  }else{
    printf("Not stable");
  }
  printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:54:25: error: invalid operands to binary == (have 'int' and 'card')
   54 |         if (data[j].num == data[minj],num){
      |             ~~~~~~~~~~~ ^~ ~~~~~~~~~~
      |                    |           |
      |                    int         card
main.c:54:39: error: 'num' undeclared (first use in this function)
   54 |         if (data[j].num == data[minj],num){
      |                                       ^~~
main.c:54:39: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

struct Card{
   char suit;
   char value;
};

void bubbleSort(struct Card *A, int N){
   int i, j;
   struct Card temp;
   for (i=0; i<N-1; i++){
      for (i=N-1; j>=i+1; j--){
         if (A[j].value<A[j-1].value){
            temp = A[j];
            A[j] = A[j-1];
            A[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", A[i].suit, A[i].value);
   }
   printf("\n");
}

void selectionSort(struct Card *A, int N){
   int i, j, minj;
   struct Card temp;
   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (A[j]<A[minj])
            minj = j;
      }
      temp = A[minj];
      A[minj] = A[i];
      A[i] = temp;
   }
   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", A[i].suit, A[i].value);
   }
   printf("\n");
}

int main()
{
   struct Card C1[100], C2[100];
   int N, i, flag = 0;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c)
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }

   bubbleSort(C1, N);
   puts("Stable");

   selectionSort(C2, N);
   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit)
         puts("Not stable");
         flag = 1;
         break;
   }
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'selectionSort':
main.c:35:18: error: invalid operands to binary < (have 'struct Card' and 'struct Card')
   35 |          if (A[j]<A[minj])
      |              ~~~~^~~~~~~~
      |               |    |
      |               |    struct Card
      |               struct Card
main.c: In function 'main':
main.c:55:23: error: 'ch' undeclared (first use in this function)
   55 |    scanf("%d%c", &N, &ch);
      |                       ^~
main.c:55:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:57:51: error: 'c' undeclared (first use in this function)
   57 |       scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c)
      |                                                   ^
main.c:57:53: error: expected ';' before 'C2'
   57 |       scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c)
      |                                                     ^
      |                                                     ;
   58 |       C2[i].suit = C1[i].suit;
      |       ~~
Language: C

#include<stdio.h>
#include<string.h>

struct Card{
   char suit;
   char value;
};

int main()
{
   struct Card C1[100], C2[100], temp;
   int N, i, flag = 0;
   char ch;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c)
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }


   for (i=0; i<N-1; i++){
      for (i=N-1; j>=i+1; j--){
         if (C1[j].value<C1[j-1].value){
            temp = C1[j];
            C1[j] = C1[j-1];
            C1[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C1[i].suit, C1[i].value);
   }
   printf("\n");

   puts("Stable");


   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (C2[j]<C2[minj])
            minj = j;
      }
      temp = C2[minj];
      C2[minj] = C2[i];
      C2[i] = temp;
   }
   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit)
         puts("Not stable");
         flag = 1;
         break;
   }
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:51: error: 'c' undeclared (first use in this function); did you mean 'ch'?
   17 |       scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c)
      |                                                   ^
      |                                                   ch
main.c:17:51: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:53: error: expected ';' before 'C2'
   17 |       scanf("%c%c%c", &C1[i].suit, &C1[i].value, &c)
      |                                                     ^
      |                                                     ;
   18 |       C2[i].suit = C1[i].suit;
      |       ~~                                             
main.c:24:19: error: 'j' undeclared (first use in this function)
   24 |       for (i=N-1; j>=i+1; j--){
      |                   ^
main.c:44:7: error: 'minj' undeclared (first use in this function)
   44 |       minj = i;
      |       ^~~~
Language: C

#include<stdio.h>
#include<string.h>

struct Card{
   char suit;
   char value;
};

int main()
{
   struct Card C1[100], C2[100], temp;
   int N, i, minj, flag = 0;
   char ch;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch)
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }


   for (i=0; i<N-1; i++){
      for (i=N-1; j>=i+1; j--){
         if (C1[j].value<C1[j-1].value){
            temp = C1[j];
            C1[j] = C1[j-1];
            C1[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C1[i].suit, C1[i].value);
   }
   printf("\n");

   puts("Stable");


   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (C2[j]<C2[minj])
            minj = j;
      }
      temp = C2[minj];
      C2[minj] = C2[i];
      C2[i] = temp;
   }
   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit)
         puts("Not stable");
         flag = 1;
         break;
   }
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:54: error: expected ';' before 'C2'
   17 |       scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch)
      |                                                      ^
      |                                                      ;
   18 |       C2[i].suit = C1[i].suit;
      |       ~~                                              
main.c:24:19: error: 'j' undeclared (first use in this function)
   24 |       for (i=N-1; j>=i+1; j--){
      |                   ^
main.c:24:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

struct Card{
   char suit;
   char value;
};

int main()
{
   struct Card C1[100], C2[100], temp;
   int N, i, minj, flag = 0;
   char ch;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch)
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }


   for (i=0; i<N-1; i++){
      for (i=N-1; j>=i+1; j--){
         if (C1[j].value<C1[j-1].value){
            temp = C1[j];
            C1[j] = C1[j-1];
            C1[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C1[i].suit, C1[i].value);
   }
   printf("\n");

   puts("Stable");


   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (C2[j].value<C2[minj].value)
            minj = j;
      }
      temp = C2[minj];
      C2[minj] = C2[i];
      C2[i] = temp;
   }
   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit)
         puts("Not stable");
         flag = 1;
         break;
   }
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:54: error: expected ';' before 'C2'
   17 |       scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch)
      |                                                      ^
      |                                                      ;
   18 |       C2[i].suit = C1[i].suit;
      |       ~~                                              
main.c:24:19: error: 'j' undeclared (first use in this function)
   24 |       for (i=N-1; j>=i+1; j--){
      |                   ^
main.c:24:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

struct Card{
   char suit;
   char value;
};

int main()
{
   struct Card C1[100], C2[100], temp;
   int N, i, minj, flag = 0;
   char ch;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }


   for (i=0; i<N-1; i++){
      for (i=N-1; j>=i+1; j--){
         if (C1[j].value<C1[j-1].value){
            temp = C1[j];
            C1[j] = C1[j-1];
            C1[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C1[i].suit, C1[i].value);
   }
   printf("\n");

   puts("Stable");


   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (C2[j].value<C2[minj].value)
            minj = j;
      }
      temp = C2[minj];
      C2[minj] = C2[i];
      C2[i] = temp;
   }
   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit)
         puts("Not stable");
         flag = 1;
         break;
   }
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:19: error: 'j' undeclared (first use in this function)
   24 |       for (i=N-1; j>=i+1; j--){
      |                   ^
main.c:24:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

struct Card{
   char suit;
   char value;
};

int main()
{
   struct Card C1[101], C2[101], temp;
   int N, i, j, minj, flag = 0;
   char ch;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }


   for (i=0; i<N-1; i++){
      for (j=N-1; j>=i+1; j--){
         if (C1[j].value<C1[j-1].value){
            temp = C1[j];
            C1[j] = C1[j-1];
            C1[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C1[i].suit, C1[i].value);
   }
   printf("\n");

   puts("Stable");


   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (C2[j].value<C2[minj].value)
            minj = j;
      }
      temp = C2[minj];
      C2[minj] = C2[i];
      C2[i] = temp;
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit){
         puts("Not stable");
         flag = 1;
         break;
      }
??????}
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:74:1: error: expected expression before '?' token
   74 | ??????}
      | ^
Language: C

#include<stdio.h>
#include<string.h>

struct Card{
   char suit;
   char value;
};

int main()
{
   struct Card C1[101], C2[101], temp;
   int N, i, j, minj, flag = 0;
   char ch;

   scanf("%d%c", &N, &ch);
   for (i=0; i<N; i++){
      scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
      C2[i].suit = C1[i].suit;
      C2[i].value = C1[i].value;
   }


   for (i=0; i<N-1; i++){
      for (j=N-1; j>=i+1; j--){
         if (C1[j].value<C1[j-1].value){
            temp = C1[j];
            C1[j] = C1[j-1];
            C1[j-1] = temp;
         }
      }
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C1[i].suit, C1[i].value);
   }
   printf("\n");

   puts("Stable");


   for (i=0; i<N; i++){
      minj = i;
      for (j=i; j<N; j++){
         if (C2[j].value<C2[minj].value)
            minj = j;
      }
      temp = C2[minj];
      C2[minj] = C2[i];
      C2[i] = temp;
   }

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (i>0)
         printf(" ");
      printf("%c%c", C2[i].suit, C2[i].value);
   }
   printf("\n");

   for (i=0; i<N; i++){
      if (C1[i].suit != C2[i].suit)
         puts("Not stable");
         flag = 1;
         break;
??????}
   if (flag==0)
      puts("Stable");

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:73:1: error: expected expression before '?' token
   73 | ??????}
      | ^
Language: C

#include<stdio.h>

void bubbleSort(char C, int n){
    int i, j;
    for(i=0; i<n; i++){
        for(j=n-1; j>i; j--){
            if()
        }
    }

}

int main(){
    int i, N;
    char card[36];

    scanf("%d", &N)
    for(i=0; i<N; i++){
        scanf("%d", &card[i];
    }



}

Compiler output:
main.c: In function 'bubbleSort':
main.c:7:16: error: expected expression before ')' token
    7 |             if()
      |                ^
main.c: In function 'main':
main.c:17:20: error: expected ';' before 'for'
   17 |     scanf("%d", &N)
      |                    ^
      |                    ;
   18 |     for(i=0; i<N; i++){
      |     ~~~             
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C

#include <stdio.h>

struct Card{ char suit,value; };

int bubble(struct Card a[],int N){
  int i,j,z;
  z=0;
  for(i=0;i<N;i++){
    for(j=N-1;j>=i+1;j--){
      if(a[j].value<a[j-1].value){
      Card
        z=a[j-1];
        a[j-1]=a[j];
        a[j]=z;
      }
    }
  }
}

int select(struct Card a[],int N){
  int i,j,s,z,minj;
  z=0;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(a[j].value<a[minj].value){
        minj=j;
      }
    }
  Card
    z=b[i];
    b[i]=b[minj];
    b[minj]=z;
  }
}

char print(struct Card a[],int N){
  int i;
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%s",a[i].suit);
  }
  printf("%d\n");
}
          
int main(void)
{
  int i,j,x,y,N,flag,a[100],b[100];
  char a1[100],b1[100];
  scanf("%d",&N);

  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
    scanf("%s",a1[i]);
  }
  for(i=0;i<N;i++){
    scanf("%d",&b[i]);
    scanf("%s",b1[i]);
    b[i]=a[i];
  }
  bubble(a,N);
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("%d\n");
  printf("Stable\n");

  select(b,N);
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",b[i]);
  }
  printf("%d\n");
  
  flag=1;
  for(i=0;flag;i++){
      flag=0;
      for(j=i+1;j<N-1;j++){
        for(x=0;x<N-1;x++){
          for(y=x+1;y<N-1;y++){
            if(a[i]==a[j]&&a[i]==b[y]&&b[j]==b[x]){
              printf("Stable\n");
              flag=1;
            }
          }
        }
      }
  printf("Not stable\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'bubble':
main.c:11:7: error: unknown type name 'Card'; use 'struct' keyword to refer to the type
   11 |       Card
      |       ^~~~
      |       struct 
main.c:12:11: error: incompatible types when initializing type 'int' using type 'struct Card'
   12 |         z=a[j-1];
      |           ^
main.c:14:14: error: incompatible types when assigning to type 'struct Card' from type 'int'
   14 |         a[j]=z;
      |              ^
main.c: In function 'select':
main.c:30:3: error: unknown type name 'Card'; use 'struct' keyword to refer to the type
   30 |   Card
      |   ^~~~
      |   struct 
main.c:31:7: error: 'b' undeclared (first use in this function)
   31 |     z=b[i];
      |       ^
main.c:31:7: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:63:10: error: passing argument 1 of 'bubble' from incompatible pointer type [-Wincompatible-pointer-types]
   63 |   bubble(a,N);
      |          ^
      |          |
      |          int *
main.c:5:24: note: expected 'struct Card *' but argument is of type 'int *'
    5 | int bubble(struct Card a[],int N){
      |            ~~~~~~~~~~~~^~~
main.c:73:10: error: passing argument 1 of 'select' from incompatible pointer type [-Wincompatible-pointer-types]
   73 |   select(b,N);
      |          ^
      |          |
      |          int *
main.c:20:24: note: expected 'struct Card *' but argument is of type 'int *'
   20 | int select(struct Card a[],int N){
      |            ~~~~~~~~~~~~^~~
Language: C

#include <stdio.h>


typedef struct{
  char mj;
  int  num;
}trump;

void show(trump A[],int N){
  for (int  i = 0; i < N; i++) {
    printf("%c%d",A[i].mj,A[i].num );
    if(i!=N-1)printf(" ");
  }
  printf("\n");
}

void bubble(trump A[],int N){
  int sw;
  char swc;
  for (int i = 0; i < N-1; i++) {
    for (int j = N-1; i < j; j--) {
      if(A[j].num < A[j-1].num){
        sw = A[j].num;
        A[j].num=A[j-1].num;
        A[j-1].num=sw;
        swc = A[j].mj;
        A[j].mj=A[j-1].mj;
        A[j-1].mj=swc;
      }
    }
  }
}

int comp(trump A[],trump B[],int N){
    for (int i = 0; i < N; i++) {
      if(A[i].mj!=B[i].mj && A[i].num!=B[i].num) return 0;
    }
    return 1;
}

void selection(trump A[],int N)
{
  int jmin;
  int sw;
  char swc;

  for (int i = 0; i < N-1; i++) {
    jmin=i;
    for (int j = i; j < N; j++) {
      if (A[jmin].num>A[j].num) {
        jmin = j;
      }
      sw = A[i].num;
      A[i].num=A[jmin].num;
      A[jmin].num=sw;
      swc = A[i].mj;
      A[i].mj=A[jmin].mj;
      A[jmin].mj=swc;
    }
  }
}

int main()
{
 trump I[100];
 trump B[100];
 int N;
 scanf("%d\n",&N);
 /*for (int i = 0; i < N; i++) {
   scanf("%c%d",&I[i].mj,&I[i].num);
   B[i].num = I[i].num;
   B[i].mj = I[i].mj;
 }*/
 int i;
 for(i=0;i<N;i++){
scanf(" %c%d",&I[i].mj,&I[i].num);
B[i]=I[i];
}
 bubble(B,N);



Compiler output:
main.c: In function 'main':
main.c:79:2: error: expected declaration or statement at end of input
   79 |  bubble(B,N);
      |  ^~~~~~
Language: C

#include <stdio.h>


typedef struct{
  char mj;
  int  num;
}trump;

void show(trump A[],int N){
  for (int  i = 0; i < N; i++) {
    printf("%c%d",A[i].mj,A[i].num );
    if(i!=N-1)printf(" ");
  }
  printf("\n");
}

void bubble(trump A[],int N){
  int sw;
  char swc;
  for (int i = 0; i < N-1; i++) {
    for (int j = N-1; i < j; j--) {
      if(A[j].num < A[j-1].num){
        sw = A[j].num;
        A[j].num=A[j-1].num;
        A[j-1].num=sw;
        swc = A[j].mj;
        A[j].mj=A[j-1].mj;
        A[j-1].mj=swc;
      }
    }
  }
}

int comp(trump A[],trump B[],int N){
    for (int i = 0; i < N; i++) {
      if(A[i].mj!=B[i].mj && A[i].num!=B[i].num) return 0;
    }
    return 1;
}

void selection(trump A[],int N)
{
  int minj;
  ztrump sw;
  for (int i = 0; i < N-1; i++) {
    minj=i;
    for (int j = i; j < N; j++) {
      if(A[minj].num>A[j].num) minj=j;
    }
    sw=A[i];A[i]=A[minj];A[minj]=sw;
  }

}

int main()
{
 trump I[100];
 trump B[100];
 int N;
 scanf("%d\n",&N);
 /*for (int i = 0; i < N; i++) {
   scanf("%c%d",&I[i].mj,&I[i].num);
   B[i].num = I[i].num;
   B[i].mj = I[i].mj;
 }*/
 int i;
 for(i=0;i<N;i++){
scanf(" %c%d",&I[i].mj,&I[i].num);
B[i]=I[i];
}
 bubble(B,N);
 show(B,N);
 if(comp(B,B,N)) printf("Stable\n"); else printf("Not Stable\n" );
 selection(I,N);
 show(I,N);
  if(comp(B,I,N)) printf("Stable\n"); else printf("Not Stable\n" );
 return 0;
}


Compiler output:
main.c: In function 'selection':
main.c:44:3: error: unknown type name 'ztrump'; did you mean 'trump'?
   44 |   ztrump sw;
      |   ^~~~~~
      |   trump
main.c:50:8: error: incompatible types when assigning to type 'int' from type 'trump'
   50 |     sw=A[i];A[i]=A[minj];A[minj]=sw;
      |        ^
main.c:50:34: error: incompatible types when assigning to type 'trump' from type 'int'
   50 |     sw=A[i];A[i]=A[minj];A[minj]=sw;
      |                                  ^~
Language: C

#include <stdio.h>
 
int main() {
  int n;
  int i,j,e;
  int a[101],b[101];
  int t,minj,flag;
  char c[101],kara,m,d[101],f[4];
  char str[3];
  int sta = 0;
 
  scanf("%d", &n);
 
  for(i=0; i<n; i++) 
  {
      scanf("%s",str);
      c[i] = str[0];
      a[i]  = str[1] - '0';
      b[i] = a[i];
      d[i] = c[i];
  }
 
  for(i = 0; i<=n-1;i++)
  {
      for(j = 0; j<=n-1;j++)
      {
          if(a[j] < a[j-1])
          {
              t = a[j];
              a[j] = a[j-1];
              a[j-1] = t;
              
              m = c[j];
              c[j] = c[j-1];
              c[j-1] = m;
          }
      }
  }
  for(i = 0;i<n;i++)
  {
      printf("%c%d",c[i],a[i]);
      if(i != n-1) printf(" ");
  }
  printf("\nStable\n");
  
  for(i = 0; i<=n-1; i++)
  {
      minj = i;
      flag = 0;
      
      for(j = i; j<=n-1;j++)
      {
          if(b[j] < b[minj])
          {
              minj = j;
              flag = 1;
          }
      }
      if(flag\ == 1)
      {
          t = b[i];
          b[i] = b[minj];
          b[minj] = t;
          
          m = d[i];
          d[i] = d[minj];
          d[minj] = m;
      }
  }
  for(i=0;i<n;i++)
  {
      printf("%c%d",d[i],b[i]);
      if(i != n-1) printf(" ");
  }
  printf("\n");
  flag = 0;
  for(j=0;j<n;j++)
  {
      if(c[j] != d[j]) flag = 1;
  }
  if(flag == 1) printf("Not stable\n");
  else printf("Stable\n");
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:59:14: error: stray '\' in program
   59 |       if(flag\ == 1)
      |              ^
Language: C

#include<iostream>
using namespase std;

struct Card{char suit, value;} ;

void bubble(struct Card A[], int N){
  for (int i = 0; i < N ; i++){
      for (int j = N; j >= i + 1; j--){
       if(A[j].value < A[j - 1].value){
         Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
        }
      }
   }
}

void selection(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){ 
        if(A[j].value < A[minj].value)minj = j;
        }
       Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
    }
 }

void print(struct Card A[], int N){
  for(int i = 0; i< N; j++){
     if(i < 0) cout  << " ";
     cout << A[i].suit << A[i].value;
}
  cout << endl
}

bool isStable(struct Card C1[], struct Card C2[], int N)
  for(int i = 0; i < N; i++){
      if(C1[i].suit != C2[i].suit) return false;
     }
   retrun true;
}

int main(){
  Card C1[100], C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
     cin >> C1[i].suit >>C1[i].value;
   }   }
   
    for(int i= 0; i < N; i++) C2[i] = C2[i];
       
       bubble(C1, N);
       selection(C2, N);

    print(C1, N);
    cout << "stable" << endl;
    print(C2, N);
    if(isStable(C1, C2, N){
       cout << " stable" << endl;
   }else{
       cout << "Not stable" << endl;
   }
 
return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;

struct Card{char suit, value; };

void bubble(struct Card A[], int N){
  for (int i = 0; i < N ; i++){
      for (int j = N - 1; j >= i + 1; j--){
       if(A[j].value < A[j - 1].value){
         Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
        }
      }
   }
}

void selection(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){ 
        if(A[j].value < A[minj].value) minj = j;
        }
       Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
    }
 }

void print(struct Card A[], int N){
  for(int i = 0; i< N; i++){
     if(i > 0) cout  << " ";
     cout << A[i].suit << A[i].value;
}
  cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int N){
  for(int i = 0; i < N; i++){
      if(C1[i].suit != C2[i].suit) return false;
     }
   retrun true;
}

int main(){
  Card C1[100], C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
     cin >> C1[i].suit >>C1[i].value;
   }   }
   
    for(int i= 0; i < N; i++) C2[i] = C1[i];
       
       bubble(C1, N);
       selection(C2, N);

    print(C1, N);
    cout << "stable" << endl;
    print(C2, N);
    if(isStable(C1, C2, N)){
       cout << " stable" << endl;
   }else{
       cout << "Not stable" << endl;
   }
 
return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;

struct Card{char suit, value; };

void bubble(struct Card A[], int N){
  for (int i = 0; i < N ; i++){
      for (int j = N - 1; j >= i + 1; j--){
       if(A[j].value < A[j - 1].value){
         Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
        }
      }
   }
}

void selection(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){ 
        if(A[j].value < A[minj].value) minj = j;
        }
       Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
    }
 }

void print(struct Card A[], int N){
  for(int i = 0; i< N; i++){
     if(i > 0) cout  << " ";
     cout << A[i].suit << A[i].value;
}
  cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int N){
  for(int i = 0; i < N; i++){
      if(C1[i].suit != C2[i].suit) return false;
     }
   retrun true;
}

int main(){
  Card C1[100], C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
     cin >> C1[i].suit >>C1[i].value;
   }   }
   
    for(int i= 0; i < N; i++) C2[i] = C1[i];
       
       bubble(C1, N);
       selection(C2, N);

    print(C1, N);
    cout << "stable" << endl;
    print(C2, N);
    if(isStable(C1, C2, N)){
       cout << " stable" << endl;
   }else{
       cout << "Not stable" << endl;
   }
 
return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

struct Card{
  char suit;
  int value;
};

  int i,j;

void bubble(struct Card A[],int n){

  for(i=0;i<n;i++){
    for(j=n-1;j>=i+1;j--){
      if(A[j].value<A[j-1].value){
	struct Card t=A[j];
	A[j]=A[j-1];
	A[j-1]=t;
      }
    }
  }
}

void selection(struct Card A[],int n){

  for(i=0;i<n;i++){
    int min=i;
    for(j=i;j<n;j++){
      if(A[j].value<A[min].value) min=j;
    }

    struct Card t=A[i];
    A[i]=A[min];
    A[min]=t;
  }
}

void print(struct Card A[],int n){
  for(i=0;i<n;i++){
    if(i>0) printf(" ");
    printf("%d%d",A[i].suit,A[i].value);
  }
  printf("\n");
}


int isStable(struct Card C1[],struct Card C2[],int n){
  for(i=0;i<n;i++){
    if(C1[i].suit!=C2[i].suit) return -1;
  }
  return 0;
}

int main(){
  struct Card C1[100],C2[100];

  int n;
  char ch;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d",&C1[i].suit,&C1[i].value);
  }

  for(i=0;i<n;i++)
    C2[i]=C1[i];

    bubble(C1,n);
    selection(C2,n);

    print(C1[i],n);
    printf("Stable\n");
    print(C2[i],n);
    if(isStable(C1,C2,n)){
      printf("Stable\n");
	}
    else printf("Not Stable\n");

    return 0;
  }



Compiler output:
main.c: In function 'main':
main.c:70:13: error: incompatible type for argument 1 of 'print'
   70 |     print(C1[i],n);
      |           ~~^~~
      |             |
      |             struct Card
main.c:37:24: note: expected 'struct Card *' but argument is of type 'struct Card'
   37 | void print(struct Card A[],int n){
      |            ~~~~~~~~~~~~^~~
main.c:72:13: error: incompatible type for argument 1 of 'print'
   72 |     print(C2[i],n);
      |           ~~^~~
      |             |
      |             struct Card
main.c:37:24: note: expected 'struct Card *' but argument is of type 'struct Card'
   37 | void print(struct Card A[],int n){
      |            ~~~~~~~~~~~~^~~
Language: C

#include<iostream>
using namespace std;

struct Card { char suit, value; };

void bubble(struct Card A[], int N){
  for ( int i = 0; i < N; i++){
    for(int j = N - 1; j >= i; j--){
      if(A[j].value < A[j - 1].value){
	Card t = A[j];
	A[j] = A[j - 1];
	A[j - 1] = t;
      }
    }
  }
}

void selection(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){
      if(A[j].value < A[minj].value)minj = j;
    }
    Card t = A[i];
    A[i] = A[minj];
    A[minj] = t;
  }
}

void print(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    if( i > 0)cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

bool isStable(struct Card C1[],struct Card C2[],int N){
  for( int i = 0; i < N; i++){
    if(C1[i].suit != C2[i].suit)return false;
  }
  return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> C1[i].suit >> C1[i].value;
  }

  for(int i = 0; i < N; i++)C2[i] = C1[i];

  bubble(C1,N);
  selection(C2,N);

  print(C1,N);
  cout << "Stable" << endl;
  print(C2,N);
  if(isStable(C1,C2,N)){
    cout << "Stable" << endl;
  }
  else{
    cout << "Not Stable" << endl;
  }

  return 0;
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

void BubSort(int *x, char **y, int n);
void SelSort(int *x, char **y, int n);
void ShowData(char **x, int n);
void AtoI(char **a, int *in, int n);
void Judge(char **x, char **y, int n);

int main() {

  int *pInt;
  int *pIntBub, *pIntSel;
  char **pChar;
  char **pCharBub, **pCharSel;
  int i;
  int n;

  scanf("%d",&n);
  
  //intメモリ領域の確保
  pInt = (int *)malloc(n * sizeof(int));
  pIntBub = (int *)malloc(n * sizeof(int));
  pIntSel = (int *)malloc(n * sizeof(int));
  
  //charメモリ領域の確保
  pChar = malloc(sizeof(char*)*n);
  for(i=0; i<n; i++)
    pChar[i] = malloc(sizeof(char) * 2);
  pCharBub = malloc(sizeof(char*)*n);
  for(i=0; i<n; i++)
    pCharBub[i] = malloc(sizeof(char) * 2);
    pCharSel = malloc(sizeof(char*)*n);
  for(i=0; i<n; i++)
    pCharSel[i] = malloc(sizeof(char) * 2);

    //入力
    for (i=0; i<n; i++)
    scanf("%s", pChar[i]);

    //atoi 
    AtoI(pChar, pInt,n);

    //コピー
    for(i=0; i<n; i++){
      pIntBub[i] = pInt[i];
      pIntSel[i] = pInt[i];
    }
    for(i=0; i<n; i++){
      pCharBub[i] = pChar[i];
      pCharSel[i] = pChar[i];
    }

    SelSort(pIntSel,pCharSel,n);
    BubSort(pIntBub,pCharBub,n);

    ShowData(pCharBub,n);
    Judge(pChar,pCharBub,n);
    ShowData(pCharSel,n);
    Judge(pChar,pCharSel,n);
    
    free(pInt);
    free(pChar);
    
    return 0;
}

void AtoI(char **a, int *in, int n){

  int i;

  for(i=0; i<n; i++){
    in[i] = atoi(&a[i][1]);
  }
}

void BubSort(int *x, char **y, int n){

  int i,j;
  int tmpInt;
  char *tmpChar;

  for(i=0; i<n-1; i++){
    for(j=n-1; j>i; j--){
      if(x[j-1] > x[j]){
	tmpInt = x[j];
	x[j] = x[j-1];
	x[j-1] = tmpInt;

	tmpChar = y[j];
	y[j] = y[j-1];
	y[j-1] = tmpChar;
      }
    }
  }
}

void SelSort(int *x, char **y, int n) {

  int i,j;
  int min;
  int tmpInt;
  char *tmpChar;

  for(i=0; i<n-1; i++){
    min = i;           //小さい値の保持
    
    for(j=i+1; j<n; j++){
      if(x[j] < x[min]){ 
	min = j;     //小さい値の更新
      }
    }
    /*sort*/
    if(x[i] > x[min]){
      tmpInt = x[i];
      x[i] = x[min];
      x[min] = tmpInt;

      tmpChar = y[i];
      y[i] = y[min];
      y[min] = tmpChar;
    }
  }
}


void ShowData(char **x, int n){

  int i;

  for(i=0; i<n; i++){
    if(i!=n-1) printf("%s ",x[i]);
    else printf("%s",x[i]);
  }

  printf("\n");
}

void Judge(char **x, char **y, int n){

  int i,j;
  char tmp;
  char tmpNum;
  int flag = 0;

  for(i=0; i<n-1; i++){
    else if(y[i][1] == y[i+1][1]){ //同じ数字があるか判定
      tmpNum = y[i][1];            //ソート後の先に来た方を保持
      tmp = y[i][0];
      for(j=0; j<n-1; j++){
	if(x[j][1] == tmpNum){ //数字が同じだったら文字が一緒か判定
	  if(x[j][0] == tmp) printf("Stable\n");
	  else printf("Not stable\n");
	  break;
	}
      }
    }
  }
}



Compiler output:
main.c: In function 'Judge':
main.c:147:5: error: 'else' without a previous 'if'
  147 |     else if(y[i][1] == y[i+1][1]){ //同じ数字があるか判定
      |     ^~~~
Language: C

#include <iostream>
using namespace std;

struct Card{ char suit; value;} ;

void bubbleSort(struct Card C[],int N){
  int i,j;
  for(i=0;i<N;i++){
    for(j=N-1;j<=i+1;j--){
      if(C[j].value<C[j-1].value){
        Card t=C[j];
        C[j]=C[j-1];
        C[j-1]=t;
      }
    }
  }
}

void selecitonSort(struct Card C[],int N){
  int i,j,minj;
  struct Card t;
  for(i=0;i<N;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(C[j].value<C[minj].value)minj=j;
    }
    Card t=C[i];
    C[i]=C[minj];
    C[minj]=t;
  }
}

int hantei(struct Card C0[],struct Card C[],int N){
  int i,j;
  for(i=0;i<N-1;i++){
    if(C[i].value==C[i+1].value){
      for(j=0;j<N-1;j++){
        if(C[i].value==C0[j].value)
          if(C[i].suit==C0[j].suit&&C[i+1].suit==C0[j+1].suit)return 1;
      }
    }  
  }
  return 0;
}

void syutryoku(struct Card C[],int N){
  int i;
  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    cout << C[i].suit << C[i].value;
  }
  cout << endl;
}
int main(){
  struct Card C0[100],C1[100],C2[100];
  int N,i;

  cin >> N

  for(i=0;i<N;i++){
    cin >> C0[i].suit >> C0[i].value
  }
  for(i=0;i<N;i++){
    C1[i]=C0[i];
    C2[i]=C0[i];
  }

  bubbleSort(C1,N);
  selecitonSort(C2,N);

  syutryoku(C1,N);
  if(hantei(C0,C1,N))cin>>"Stable">>endl;
  else cin>>"Not stable">>endl;

  syutryoku(C2,N);
  if(hantei(C0,C2,N))cin>>"Stable">>endl;
  else cin>>"Not stable">>endl;
  
  return 0;
}



Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;

struct Card { char suit, value; };

void bubble(struct Card A[],int N){
  for(int i = 0; i < N; i++){
    for(int j = N - 1; j <= i + 1; j--){
      if(A[j].value < A[j - 1].value){
	Card t = A[j];
	A[j] = A[j - 1];
	A[j - 1] = t;
      }
    }
  }
}

void selection(struct Card A[],int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){
      if(A[j].value < A[minj].value) minj = j;
    }
    Card t = A[i];
    A[i] = A[minj];
    A[minj] = t;
  }
}

void print(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    if (i > 0)cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

bool isStable(struct Card C1[],struct Card C2[],int N){
   for(int i = 0; i < N; i++){
     if(C1[i].suit != C2[i].suit)return false;
   }
   return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> C1[i].suit >> C1[i].value;
  }

  for(int i = 0; i < N; i++)C2[i] = C1[i];

  bubble(C1,N);
  selection(C2,N);

  print(C1,N);
  cout << "Stable" << endl;
  print(C2,N);
  if(isStable(C1,C2,N)){
    cout << "Stable" << endl;
  }
  else {
    cout << "Not stable" << endl;
  }
  return 0;
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;

struct Card { char suit, value; };

void bubble(struct Card A[],int N){
  for(int i = 0; i < N; i++){
    for(int j = N - 1; j < i + 1; j--){
      if(A[j].value < A[j - 1].value){
	Card t = A[j];
	A[j] = A[j - 1];
	A[j - 1] = t;
      }
    }
  }
}

void selection(struct Card A[],int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){
      if(A[j].value < A[minj].value) minj = j;
    }
    Card t = A[i];
    A[i] = A[minj];
    A[minj] = t;
  }
}

void print(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    if (i > 0)cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

bool isStable(struct Card C1[],struct Card C2[],int N){
   for(int i = 0; i < N; i++){
     if(C1[i].suit != C2[i].suit)return false;
   }
   return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> C1[i].suit >> C1[i].value;
  }

  for(int i = 0; i < N; i++)C2[i] = C1[i];

  bubble(C1,N);
  selection(C2,N);

  print(C1,N);
  cout << "Stable" << endl;
  print(C2,N);
  if(isStable(C1,C2,N)){
    cout << "Stable" << endl;
  }
  else {
    cout << "Not stable" << endl;
  }
  return 0;
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>

using namespace std;

struct Card{
    char suit, value;
};

void bubbleSort(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        for(int j = N - 1; j >= i+1; j--){
            if(A[j].value < A[j-1].value){
                Card t = A[j]; A[j] = A[j-1]; A[j-1] = t;
            }
        }
    }
}

void selectionSort(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        int minj = i;
        for(int j = i; j < N; j++){
            if(A[minj].value > A[j].value) minj = j;
        }
        Card t = A[i]; A[i] = A[minj]; A[minj] = t;
    }
}

bool judgeStable(struct Card A[], struct Card B[], int N){
    for(int i = 0; i < N; i++) if(A[i].suit != B[i].suit) return false;
    return true;
}

void printData(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        if(i != 0) cout << " ";
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

int main(){
    struct Card C1[100], C2[100];
    int N;
    
    cin >> N;

    for(int i = 0; i < N; i++) cin >> C1[i].suit >> C1[i].value;

    for(int i = 0; i < N; i++) C2[i] = C1[i];

    bubbleSort(C1, N);
    selectionSort(C2, N);

    printData(C1, N);
    cout << "Stable" << endl;

    printData(C2, N);
    if(judgeStable(C1, C2, N)){
        cout << "Stable" << endl;
    }else{
        cout << "Not stable" << endl;
    }


    return 0;
}




Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

#define SWAP(x, y) {char *z; z = x; x = y; y = z;}

void dispIsStable(char **cards1, char **cards2, int card_num) 
{
	int i;

	for(i = 0; i < card_num; i++) {
		if(strcmp(cards1[i], cards2[i]) != 0) {
			printf("Not stable\n");
			return;
		}
	}
	printf("Stable\n");
}

int cardtoi(char *card)
{
	return atoi(card + 1);
}

void dispCards(char **cards, int card_num) 
{
	int i;

	printf("%s", cards[0]);
	
	for(i = 1; i < card_num; i++) {
		printf(" %s", cards[i]);
	}
	printf("\n");
}

void bubbleSort(char **cards, int card_num)
{
	int i, j;

	for(i = 0; i < card_num - 1; i++) {
		for(j = card_num - 1; j > i; j--) {
			if(cardtoi(cards[j]) < cardtoi(cards[j - 1]))
				SWAP(cards[j], cards[j - 1]);
		}
	}

}

void selectionSort(char **cards, int card_num) 
{
	int i, j, min_index;

	for(i = 0; i < card_num; i++) {
		min_index = i;
		for(j = i; j < card_num; j++) {
			if(cardtoi(cards[j]) < cardtoi(cards[min_index]))
				min_index = j;
		}
		if(min_index != i)
			SWAP(cards[i], cards[min_index]);
	}

}

int main(void) 
{
	int n, i;
	char **cards4bubble, **cards4selection;

	scanf("%d", &n);
	cards4bubble = malloc(sizeof(char *) * n);	
	cards4selection = malloc(sizeof(char *) * n);
	for(i = 0; i < n; i++) {
		cards4bubble[i] = malloc(sizeof(char) * 2);
		scanf("%s", cards4bubble[i]);
		cards4selection[i] = strdup(cards4bubble[i]);
	}
	bubbleSort(cards4bubble, n);
	selectionSort(cards4selection, n);
	dispCards(cards4bubble, n);
	printf("Stable\n");
	dispCards(cards4selection, n);
	dispIsStable(cards4bubble, cards4selection, n);
	return 0;



Compiler output:
main.c: In function 'main':
main.c:85:9: error: expected declaration or statement at end of input
   85 |         return 0;
      |         ^~~~~~