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

#include<iostream>
//alds1_2_c.cpp
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; 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>
  #define N 100

  typedef struct{
    char a;
    char value;
  }Card_t;

  void bubble(Card_t A[],int v){
    int i,j;
    Card_t t;
    for(i=0;i<v;i++){
      for(j=v-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 selection(Card_t A[],int v){
    int i,j;
    int minj;
    Card_t t;
    for(i=0;i<v;i++){
      minj=i;
      for(j=i;j<v;j++){
        if(A[j].value<A[minj].value){
          minj=j;
        }
      }
        t=A[i];
        A[i]=A[minj];
        A[minj]=t;
      }
    }
  }

  int isStable(Card_t C1[],Card_t C2[],int v){
   int i;
   for(i=0;i<v;i++){
     if(C1[i].a != C2[i].a) return 0; //false
   }
   return 1; //true
  }

  int main(){
    Card_t C1[N],C2[N];
    int v,i,j;
    char S[3];

    scanf("%d",&v);
    for(i=0;i<v;i++){
      scanf("%s",S);
      C1[i].a=S[0];
      C1[i].value=S[1];
    }

    for(i=0;i<v;i++){
      C2[i]=C1[i];
    }

    bubble(C1,v);
    selection(C2,v);
    for(i=0;i<v;i++){
      if(i>0) printf(" ");
      S[0]=C1[i].a;
      S[1]=C1[i].value;
      printf("%s",S);
    }
    printf("\n");
    printf("Stable\n");

    for(i=0;i<v;i++){
      if(i>0) printf(" ");
      S[0]=C2[i].a;
      S[1]=C2[i].value;
      printf("%s",S);
    }
    printf("\n");
    if(isStable(C1,C2,v)==1) {
      printf("Stable\n");
    } else {
      printf("Not stable\n");
    }
    return 0;
  }

Compiler output:
main.c:39:3: error: expected identifier or '(' before '}' token
   39 |   }
      |   ^
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<stdio.h>
#include<stdlib.h>
#define N 36
#define TRUE 1
#define FALSE 0
 
typedef struct {
    char mark;
    int atai;
} Card;
 
int eq_cards(Card a, Card b){
    if(a.value == b.value && a.suit == b.suit) return TRUE;
    else return FALSE;
}
 
void swap(Card *a, Card *b){
    Card temp;
    temp = *a;
    *a = *b;
    *b = temp;
    return;
}
 
Card* selectionsort(int n, Card *r){
    int i,j,minj;
    Card *res;
    res = (Card *)malloc(N * sizeof(Card));
    for(i=0;i<n;i++) res[i] = r[i];
 
    for(i=0;i<n;i++){
        minj = i;
        for(j=i;j<n;j++){
            if(res[j].atai<res[minj].atai) minj = j;
        }
        swap(&res[i], &res[minj]);
    }
    return res;
}
 
Card* bubblesort(int n, Card *r){
    int flag = 1;
    int i;
    Card *res;
    res = (Card *)malloc(N * sizeof(Card));
    for(i=0;i<n;i++) res[i] = r[i];
 
    while(flag){
        flag = 0;
        for(i=n-1;i>0;i--){
            if(res[i].atai<res[i-1].atai){
                swap(&res[i], &res[i-1]);
                flag = 1;
            }
        }
    }
    return res;
}
 
void print_array(Card *cs, int n){
    int i;
    for(i=0;i<n-1;i++) printf("%c%d ", cs[i].mark, cs[i].atai);
    printf("%c%d\n", cs[n-1].mark, cs[n-1].atai);
 
}
 
int is_stable(Card *b, Card *a, int n){
    int i, j, k, l;
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
            for(k=0;k<n;k++)
                for(l=k+1;l<n;l++)
                    if(b[i].atai == b[j].atai && eq_cards(b[i], a[l]) && eq_cards(b[j], a[k])) return FALSE;
    return TRUE;
}
 
int main(){
    int n;
    Card r[N];
    int i, j;
    Card *b_res, *s_res;
 
    scanf("%d", &n);
    for(i=0;i<n;i++) scanf(" %c%d", &r[i].mark, &r[i].atai);
 
    b_res = bubblesort(n, r);
    s_res = selectionsort(n, r);
     
    print_array(b_res, n);
    if(is_stable(r, b_res, n)==TRUE) printf("Stable\n");
    else printf("Un stable\n");
    print_array(s_res, n);
    if(is_stable(r, s_res, n)==TRUE) printf("Stable\n");
    else printf("Not stable\n");
     
    free(b_res);
    free(s_res);
    return 0;
}

Compiler output:
main.c: In function 'eq_cards':
main.c:13:9: error: 'Card' has no member named 'value'
   13 |     if(a.value == b.value && a.suit == b.suit) return TRUE;
      |         ^
main.c:13:20: error: 'Card' has no member named 'value'
   13 |     if(a.value == b.value && a.suit == b.suit) return TRUE;
      |                    ^
main.c:13:31: error: 'Card' has no member named 'suit'
   13 |     if(a.value == b.value && a.suit == b.suit) return TRUE;
      |                               ^
main.c:13:41: error: 'Card' has no member named 'suit'
   13 |     if(a.value == b.value && a.suit == b.suit) return TRUE;
      |                                         ^
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

struct card {
    char suit;
    int value;
};

void bubbleSort(card A[], const int N)
{
    int flag = 1;

    for( int i = 0; flag; ++i ){
        flag = 0;

        for( int j = N-1; i < j; --j )
            if( A[j].value < A[j-1].value ){
                swap(A[j], A[j-1]);
                flag = 1;
            }
    }
}

void selectionSort(card A[], const int N)
{
    for( int i = 0; i < N; ++i ){
        int min = i;
      
        //i???????????§A[i]?????????????°???????????????????????±???????
        for( int j = i; j < N; ++j )
            if( A[j].value < A[min].value )
                min = j;
       
        //i??¨min?????°????????°??????
        if( i != min ) swap(A[i], A[min]);
    }
}

int main()
{
    //??\???
    int N;
    scanf("%d%*c", &N);
    card A[N], B[N]; //A:bubbleSort, B:selectionSort
    for( int i = 0; i < N; ++i ){
        scanf("%c%d%*c", &A[i].suit, &A[i].value);
        B[i] = A[i];
    }


    bubbleSort(A, N);
    selectionSort(B, N);


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

    //?????????????????????????????????
    int flag = 1;
    for( int i = 0; i < N; ++i ){
        if( 0 < i ) printf(" ");
        printf("%c%d", B[i].suit, B[i].value);
        if( !(B[i].suit == A[i].suit && B[i].value == A[i].value) ) flag = 0;
    }
    printf("\n");
    if( flag ) printf("Stable\n");
    else printf("Not stable\n");

    return 0;
}

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

#include<stdio.h>
typedef struct{
  int k;
  char mozi;
}card;
  
int main(){
  int i,j,n,min;
  card num[36],suit[36],temp;
   
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf(" %c%d", &num[i].mozi, &num[i].k);
    suit[i].mozi = num[i].mozi;
    suit[i].value = num[i].k;
  }
  
  for(i = 0; i < n; i++){
    for(j = n-1; j > i; j--){
      if(num[j].k < num[j-1].k){
	temp = num[j];
	num[j] = num[j-1];
	num[j-1] = temp;
      }
    }
  }
 
  for(i = 0; i < n-1; i++){
    printf("%c%d ",num[i].mozi, num[i].k);
  }
  printf("%c%d\nStable\n",num[i].mozi, num[i].k);
 
  for(i = 0; i < n-1; i++){
    min = i;
    for(j = i; j <= n-1; j++){
      if(suit[j].k < suit[min].k) min = j;
    }
    temp = suit[i];
    suit[i]=suit[min];
    suit[min]=temp;
  }
 
  for(i = 0; i < n-1; i++){
    printf("%c%d ",suit[i].mozi,suit[i].k);
  }
  printf("%c%d\n",suit[i].mozi,suit[i].k);
  
  for(i = 0; i < n; i++){
    if(suit[i].mozi != num[i].mozi) {
      printf("Not stable\n");
      break;
    }
  }
  if(i == n)printf("Stable\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:12: error: 'card' has no member named 'value'
   15 |     suit[i].value = num[i].k;
      |            ^
Language: C

#include<stdio.h>
 typedef struct {
  char mark;
  int value;
} card;
 
void swap(card * , card *);
void SelectionSort(card * ,int N);
void BubbleSort(card * , int N);
 
 
 
int main() {
  int i,N,flag=1;
 
   while(1) {
    scanf("%d ",&N);
    if(1<=N && N<=36) break;
  }
 
   card  C1[100],C2[100];
  for(i=0;i<N;i++)  {
    scanf("%c%d ",&C1[i].mark , &C1[i].value);
      //printf("%c%d",C1[i].mark,C1[i].value);
    C2[i] = C1[i];
  }
 
  BubbleSort(C1,N);
  SelectionSort(C2,N);
 
  for(i=0;i<N;++i) {
    if(0 < i)printf(" ");
    printf("%c%d",C1[i].mark,C1[i].value);
  }
  printf("\n");
  printf("Stable\n");
 
  for(i=0;i<N;i++){
    if(0<i)printf(" ");
    printf("%c%d",C2[i].mark,C2[i].value);
    if(!(C2[i].mark == C1[i].mark && C2[i].value == C1[i].value))flag = 0;
  }
  printf("\n");
  if(flag) printf("Stable\n");
  else printf("Not stable\n");
 
  return 0;
}
 
void swap( card *a,   card *b)
{
  card t;
  t = *a;
  *a  = *b;
  *b =t;
}
 
 
 void BubbleSort(  card *C, int N)
 {
   int i,j;
   for(i=0;i < N-1;i++) {
     for(j =N-1;j>=i;j--) {
       if(C[j].value < C[j-1].value) swap(&C[j],&C[j-1]);
     }
   }
 }
 
void SelectionSort( card *C, int N)
 {
   int i,j,minj;
   for(i=0;i<N;i++) {
     minj = i;
     for(j=i;j<N;j++){
       if(C[j].value < C[minj].value)minj =j;
     }
       swap( &C[i] , &C[minj]);
   }
 

Compiler output:
main.c: In function 'SelectionSort':
main.c:78:4: error: expected declaration or statement at end of input
   78 |    }
      |    ^
Language: C

#include<stdio.h>
 
typedef struct
{
  int num;
  char mark;
} card;
 
int length;
int i, j;
card orig_n[36];
card sort_n[36];
card tmp;
 
void ScanCards(){
  char c;
 
  scanf("%d", &length);
  for(i=0;i<length;i++){
      while(1){
      c = getchar();
      if(c != ' ' && c != '\n') break;
      }
      orig_n[i].mark=c;
      scanf("%d",&orig_n[i].num);
      orig_n[i]=orig_n[i];
    }
}

void BubbleSort(){
  int flag;
 
  for(i=0;i<length;i++) sort_n[i]=orig_n[i];
 
  for(i=0;i<length;i++){
      flag=0;
      for(j=length-1;j>i;j--){
      if(sort_n[j-1].num>sort_n[j].num){
          tmp=sort_n[j];
          sort_n[j]=sort_n[j-1];
          sort_n[j-1]=tmp;
          flag=1;
        }
    }
      if(flag==0) break;
    }
}

void SelectionSort(){
  int min_i;
 
  for(i=0;i<length;i++) sort_n[i]=orig_n[i];
 
  for(i=0;i<length;i++){
      min_i=i;
      for(j=i;j<length;j++){
      if(sort_n[j].num<sort_n[min_i].num) min_i=j;
    }
      tmp=sort_n[i];
      sort_n[i]=sort_n[min_i];
      sort_n[min_i]=tmp;
    }

}

void PrintSortedCards(){
  for(i=0;i<length-1;i++){
      printf("%c%d ", sort_n[i].mark, sort_n[i].num);
    }
  printf("%c%d\n", sort_n[length-1].mark, sort_n[length-1].num);
}

void JudgeStable(){
  int s1,s2;
  int flag=0;
 
  for(i=0;i<length;i++){
      if(sort_n[i].num == sort_n[i+1].num){
      for(j=0;j<length;j++){
	if((sort_n[i].num==orig_n[j].num) && (sort_n[i].mark==orig_n[j].mark)) s1=j;
          if((sort_n[i + 1].num == orig_n[j].num) && (sort_n[i + 1].mark==orig_n[j].mar)k) s2=j;
        }
      if(s1>s2) flag=1;
    }
      if(flag==1) break;
    }
  if(flag==0) printf("Stable\n");
  else printf("Not stable\n");
 
}

int main()
{
  ScanCards();
 
  BubbleSort();
 
  PrintSortedCards();
 
  JudgeStable();
 
  SelectionSort();
 
  PrintSortedCards();
 
  JudgeStable();
 
  return 0;
}
 

Compiler output:
main.c: In function 'JudgeStable':
main.c:81:85: error: 'card' has no member named 'mar'; did you mean 'mark'?
   81 |           if((sort_n[i + 1].num == orig_n[j].num) && (sort_n[i + 1].mark==orig_n[j].mar)k) s2=j;
      |                                                                                     ^~~
      |                                                                                     mark
main.c:81:89: error: expected ')' before 'k'
   81 |           if((sort_n[i + 1].num == orig_n[j].num) && (sort_n[i + 1].mark==orig_n[j].mar)k) s2=j;
      |             ~                                                                           ^
      |                                                                                         )
Language: C

#include<stdio.h>

void bubblesort(char,int,int)
void selectionsort(char,int,int)
int isStable(char,int,char,int,int)

int main(void)
{
int N,i;
scanf("%d\n",&N);
int number[N];
char suit[N];
for(i=0;i<N;i++) scanf("%c%d ",&suit[i],&number[i]);
bubblesort(suit,number,N)
selectionsort(suit,number,N)
return 0;
}

void selectionsort(char *tagin,int *arrayin,int N)
{
int i,mini,j,a,arrayout[N];
char tagout[N],tagA;
memcpy(tagout,tagin,sizeof(tagin));
memcpy(arrayout,arrayin,sizeof(arrayin));
for(i=0;i<N-1;i++)
{
mini=i;
for(j=i+1;j<N;j++)
{
if(arrayout[j]<arrayout[mini]) mini=j;
}
a=arrayout[i],tagA=tagout[i];
arrayout[i]=arrayout[mini],tagout[i]=tagout[mini];
arrayout[mini]=a,tagout[mini]=tagout[i];
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tag[N-1],array[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)) printf("Stable\n");
else printf("not Stable\n");
}

void bubblesort(char *tagin,int *arrayin,int N)
{
int i=0,j,flag=1,a,arrayout[N];
char tagout[N],tagA;
while flag
{
flag=0;
for(j=N-1;j>i;j--)
{
if(arrayout[j]<arrayout[j-1])
{
a=arrayout[j],tagA=tagout[j];
arrayout[j]=arrayout[j-1],tagout[j]=tagout[j-1];
arrayout[j-1]=a,tagout[j-1]=tagA;
flag=1;
}
}
i++;
}
for(i=0;i<N-1;i++) printf("%c%d ",tag[i],array[i]);
printf("%c%d\n",tag[N-1],array[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)) printf("Stable\n");
else printf("not Stable\n");
}

int isStable(char *tagin,int *numberin,char *tagout,int *numberout,int N)
{
int i,j,a,b;
for(i=0;i<N;i++)
{
for(j=i+1;j<N;j++)
{
for(a=0;a<N;a++)
{
for(b=a+1;b<n;b++)
{
if(numberin[i]=numberin[j] && numberin[i]==numberout[b] && tagin[i]=tagin[b] && numberin[j]==numberout[a] && tagin[j]=tagin[a] return 0;
}
}
}
}
return 1;
}

Compiler output:
main.c: In function 'bubblesort':
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    5 | int isStable(char,int,char,int,int)
      | ^~~
main.c:20:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   20 | {
      | ^
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   43 | {
      | ^
main.c:68:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   68 | {
      | ^
main.c:85: error: expected '{' at end of input
Language: C

#include<stdio.h>

void bubblesort(char*,int*,int);
void selectionsort(char*,int*,int);
int isStable(char*,int*,char*,int*,int);

int main(void)
{
int N,i;
scanf("%d\n",&N);
int number[N];
char suit[N];
for(i=0;i<N;i++) scanf("%c%d ",&suit[i],&number[i]);
bubblesort(suit,number,N);
selectionsort(suit,number,N);
return 0;
}

void selectionsort(char *tagin,int *arrayin,int N)
{
int i,mini,j,a,arrayout[N];
char tagout[N],tagA;
memcpy(tagout,tagin,sizeof(tagin));
memcpy(arrayout,arrayin,sizeof(arrayin));
for(i=0;i<N-1;i++)
{
mini=i;
for(j=i+1;j<N;j++)
{
if(arrayout[j]<arrayout[mini]) mini=j;
}
a=arrayout[i],tagA=tagout[i];
arrayout[i]=arrayout[mini],tagout[i]=tagout[mini];
arrayout[mini]=a,tagout[mini]=tagout[i];
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tagout[N-1],arrayout[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)) printf("Stable\n");
else printf("not Stable\n");
}

void bubblesort(char *tagin,int *arrayin,int N)
{
int i=0,j,flag=1,a,arrayout[N];
char tagout[N],tagA;
while(flag)
{
flag=0;
for(j=N-1;j>i;j--)
{
if(arrayout[j]<arrayout[j-1])
{
a=arrayout[j],tagA=tagout[j];
arrayout[j]=arrayout[j-1],tagout[j]=tagout[j-1];
arrayout[j-1]=a,tagout[j-1]=tagA;
flag=1;
}
}
i++;
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tagout[N-1],arrayout[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)) printf("Stable\n");
else printf("not Stable\n");
}

int isStable(char *tagin,int *numberin,char *tagout,int *numberout,int N)
{
int i,j,a,b;
for(i=0;i<N;i++)
{
for(j=i+1;j<N;j++)
{
for(a=0;a<N;a++)
{
for(b=a+1;b<N;b++)
{
if(numberin[i]=numberin[j] && numberin[i]==numberout[b] && tagin[i]=tagin[b] && numberin[j]==numberout[a] && tagin[j]=tagin[a]) return 0;
}
}
}
}
return 1;
}

Compiler output:
main.c: In function 'selectionsort':
main.c:23:1: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
   23 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'memcpy'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:23:1: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
   23 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:23:1: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c: In function 'isStable':
main.c:78:118: error: lvalue required as left operand of assignment
   78 | if(numberin[i]=numberin[j] && numberin[i]==numberout[b] && tagin[i]=tagin[b] && numberin[j]==numberout[a] && tagin[j]=tagin[a]) return 0;
      |                                                                                                                      ^
Language: C

#include<stdio.h>

void bubblesort(char*,int*,int);
void selectionsort(char*,int*,int);
int isStable(char*,int*,char*,int*,int);

int main(void)
{
int N,i;
scanf("%d\n",&N);
int number[N];
char suit[N];
for(i=0;i<N;i++) scanf("%c%d ",&suit[i],&number[i]);
bubblesort(suit,number,N);
selectionsort(suit,number,N);
return 0;
}

void selectionsort(char *tagin,int *arrayin,int N)
{
int i,mini,j,a,arrayout[N];
char tagout[N],tagA;
memcpy(tagout,tagin,sizeof(tagin));
memcpy(arrayout,arrayin,sizeof(arrayin));
for(i=0;i<N-1;i++)
{
mini=i;
for(j=i+1;j<N;j++)
{
if(arrayout[j]<arrayout[mini]) mini=j;
}
a=arrayout[i],tagA=tagout[i];
arrayout[i]=arrayout[mini],tagout[i]=tagout[mini];
arrayout[mini]=a,tagout[mini]=tagA;
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tagout[N-1],arrayout[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)==1) printf("Stable\n");
else printf("Not stable\n");
}

void bubblesort(char *tagin,int *arrayin,int N)
{
int i=0,j,flag=1,a,arrayout[N];
char tagout[N],tagA;
memcpy(tagout,tagin,sizeof(tagin));
memcpy(arrayout,arrayin,sizeof(arrayin));
while(flag)
{
flag=0;
for(j=N-1;j>i;j--)
{
if(arrayout[j]<arrayout[j-1])
{
a=arrayout[j],tagA=tagout[j];
arrayout[j]=arrayout[j-1],tagout[j]=tagout[j-1];
arrayout[j-1]=a,tagout[j-1]=tagA;
flag=1;
}
i++;
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tagout[N-1],arrayout[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)==1) printf("Stable\n");
else printf("Not stable\n");
}

int isStable(char *tagin,int *numberin,char *tagout,int *numberout,int N)
{
int i,j,a,b;
for(i=0;i<N;i++)
{
for(j=i+1;j<N;j++)
{
for(a=0;a<N;a++)
{
for(b=a+1;b<N;b++)
{
if(numberin[i]==numberin[j] && numberin[i]==numberout[b] && tagin[i]==tagin[b] && numberin[j]==numberout[a] && tagin[j]==tagin[a]) return 0;
}
}
}
}
return 1;
}

Compiler output:
main.c: In function 'selectionsort':
main.c:23:1: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
   23 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'memcpy'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:23:1: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
   23 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:23:1: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c: In function 'bubblesort':
main.c:46:1: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
   46 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:46:1: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c:85:1: error: expected declaration or statement at end of input
   85 | }
      | ^
Language: C

#include<stdio.h>
 
void bubblesort(char*,int*,int);
void selectionsort(char*,int*,int);
int isStable(char*,int*,char*,int*,int);
 
int main(void)
{
int N,i;
scanf("%d\n",&N);
int number[N];
char suit[N];
for(i=0;i<N;i++) scanf("%c%d ",&suit[i],&number[i]);
bubblesort(suit,number,N);
selectionsort(suit,number,N);
return 0;
}
 
void selectionsort(char *tagin,int *arrayin,int N)
{
int i,mini,j,a,arrayout[N];
char tagout[N],tagA;
memcpy(tagout,tagin,sizeof(tagin));
memcpy(arrayout,arrayin,sizeof(arrayin));
for(i=0;i<N-1;i++)
{
mini=i;
for(j=i+1;j<N;j++)
{
if(arrayout[j]<arrayout[mini]) mini=j;
}
a=arrayout[i],tagA=tagout[i];
arrayout[i]=arrayout[mini],tagout[i]=tagout[mini];
arrayout[mini]=a,tagout[mini]=tagA;
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tagout[N-1],arrayout[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)==1) printf("Stable\n");
else printf("Not stable\n");
}
 
void bubblesort(char *tagin,int *arrayin,int N)
{
int i=0,j,flag=1,a,arrayout[N];
char tagout[N],tagA;
memcpy(tagout,tagin,sizeof(tagin));
memcpy(arrayout,arrayin,sizeof(arrayin));
while(flag)
{
flag=0;
for(j=N-1;j>i;j--)
{
if(arrayout[j]<arrayout[j-1])
{
a=arrayout[j],tagA=tagout[j];
arrayout[j]=arrayout[j-1],tagout[j]=tagout[j-1];
arrayout[j-1]=a,tagout[j-1]=tagA;
flag=1;
}
i++;
}
for(i=0;i<N-1;i++) printf("%c%d ",tagout[i],arrayout[i]);
printf("%c%d\n",tagout[N-1],arrayout[N-1]);
if(isStable(tagin,arrayin,tagout,arrayout,N)==1) printf("Stable\n");
else printf("Not stable\n");
}
 
int isStable(char *tagin,int *numberin,char *tagout,int *numberout,int N)
{
int i,j,a,b;
for(i=0;i<N;i++)
{
for(j=i+1;j<N;j++)
{
for(a=0;a<N;a++)
{
for(b=a+1;b<N;b++)
{
if(numberin[i]==numberin[j] && numberin[i]==numberout[b] && tagin[i]==tagin[b] && numberin[j]==numberout[a] && tagin[j]==tagin[a]) return 0;
}
}
}
}
return 1;
}

Compiler output:
main.c: In function 'selectionsort':
main.c:23:1: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
   23 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'memcpy'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:23:1: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
   23 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:23:1: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c: In function 'bubblesort':
main.c:46:1: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
   46 | memcpy(tagout,tagin,sizeof(tagin));
      | ^~~~~~
main.c:46:1: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c:85:1: error: expected declaration or statement at end of input
   85 | }
      | ^
Language: C

#include <stdio.h>
#include
#define N 36
int main(){
  int i,j,k=0,n,tmp,min,flag;
  char A[N],;
  scanf("%d",&n);
  for(j=0;j<=n-1;j++){
    scanf("%s",&A[j]);
  }
  
    for(i=0;i<=n-1;i++){
    for(j=n-1;j>i;j--){
      if(A[j]<A[j-1]){
	tmp=A[j-1];
	A[j-1]=A[j];
	A[j]=tmp;
	k++;
      }
    }
  }
  for(i=0;i<=n-1;i++){
    flag=0;
    min=i;
    for(j=i;j<=n-1;j++){
      if(A[j]<A[min]){
	min=j;
	flag=1;
      }
    }
    if(flag==1){
      tmp=A[i];
      A[i]=A[min];
      A[min]=tmp;
      k++;
    }
  }
  for(j=0;j<=n-1;j++){   
    printf("%d",A[j]);
    if(j<n-1)
      printf(" ");
  }
  printf("\n");
  printf("%d\n",k);
  return 0;
}

Compiler output:
main.c:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |         ^
main.c: In function 'main':
main.c:6:13: error: expected identifier or '(' before ';' token
    6 |   char A[N],;
      |             ^
Language: C

#include<stdio.h>

struct Card{
  char mark;
  char value;
};

int main(){

  struct Card C1[101], C2[101],C3;
  int n, i, j, mini, flag = 0;
  char ch;

  scanf("%d%c", &n, &ch);

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

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

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

  for(i=0; i<=n-1; i++){
    mini = i;
    for(j=i; j<=n-1; j++)
      if(C2[j].value < C2[mini].value) mini = j;
    }
    if(mini != i) {
      C3 = C2[i];
      C2[i] = C2[mini];
      C2[mini] = C3;
    }
  }

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

  for(i=0; i<n; i++){
    if(i) printf(" ");
    printf("%c%c",C2[i].mark,C2[i].value);
    if(C1[i].mark == C2[i].mark) flag++;
  }
  printf("\n");
  if(hantei == n) printf("Stable\n");
  else printf("Not stable\n");


  return 0;
}

Compiler output:
main.c:46:3: error: expected identifier or '(' before 'for'
   46 |   for(i=0; i<n; i++){
      |   ^~~
main.c:46:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   46 |   for(i=0; i<n; i++){
      |             ^
main.c:46:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   46 |   for(i=0; i<n; i++){
      |                  ^~
main.c:50:10: error: expected declaration specifiers or '...' before string constant
   50 |   printf("\n");
      |          ^~~~
main.c:51:10: error: expected declaration specifiers or '...' before string constant
   51 |   printf("Stable\n");
      |          ^~~~~~~~~~
main.c:53:3: error: expected identifier or '(' before 'for'
   53 |   for(i=0; i<n; i++){
      |   ^~~
main.c:53:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   53 |   for(i=0; i<n; i++){
      |             ^
main.c:53:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   53 |   for(i=0; i<n; i++){
      |                  ^~
main.c:58:10: error: expected declaration specifiers or '...' before string constant
   58 |   printf("\n");
      |          ^~~~
main.c:59:3: error: expected identifier or '(' before 'if'
   59 |   if(hantei == n) printf("Stable\n");
      |   ^~
main.c:60:3: error: expected identifier or '(' before 'else'
   60 |   else printf("Not stable\n");
      |   ^~~~
main.c:63:3: error: expected identifier or '(' before 'return'
   63 |   return 0;
      |   ^~~~~~
main.c:64:1: error: expected identifier or '(' before '}' token
   64 | }
      | ^
Language: C

 
#include<stdio.h>
#include<stdlib.h>
 
typedef struct{
  char m;
  int v;
} card;
 
#define MAX 36
 
int N;
int isStable(c *in, c*out){
  int i;
 
  for(i=0;i<N;i++){
    if(in[i].m!=out[i].m){
      return 0;
    }
  }
 
  return 1;
}
 
int main(){
  int i,j,min,is;
  card c1[MAX],c2[MAX],t;
 
  scanf("%d",&N);
  if(N<1 || N>MAX){
    exit(1);
  }
  for(i=0;i<N;i++){
    scanf(" %c%d",&c1[i].m,&c1[i].v);
  }
 
  for(i=0;i<N;i++){
    c2[i]=c1[i];
  }
 
  for(i=0;i<N;i++){
    for(j=N-1;j>=i+1;j--){
      if(c1[j].v<C1[j-1].v){
    t=c1[j];
    c1[j]=c1[j-1];
    c1[j-1]=t;
      }
    }
  }
 
  for(i=0;i<N;i++){
    min=i;
    for(j=i;j<N;j++){
      if(c2[j].v<c2[min].v){
    min=j;
      }
    }
    t=c2[i];
    c2[i]=c2[minj];
    c2[min]=t;
  }
 
  for(i=0;i<N-1;i++){
    printf("%c%d ",c1[i].m,c1[i].v);
  }
  printf("%c%d\n",c1[N-1].m,c1[N-1].v);
  printf("Stable\n");
 
  is=isStable(c1,c2);
 
  for(i=0;i<N-1;i++){
    printf("%c%d ",c2[i].m,c2[i].v);
  }
  printf("%c%d\n",c2[N-1].m,c2[N-1].v);
  if(is==1){
    printf("Stable\n");
  }else{
    printf("Not stable\n");
  }
 
  return 0;
}

Compiler output:
main.c:13:14: error: unknown type name 'c'
   13 | int isStable(c *in, c*out){
      |              ^
main.c:13:21: error: unknown type name 'c'
   13 | int isStable(c *in, c*out){
      |                     ^
main.c: In function 'main':
main.c:43:18: error: 'C1' undeclared (first use in this function); did you mean 'c1'?
   43 |       if(c1[j].v<C1[j-1].v){
      |                  ^~
      |                  c1
main.c:43:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:59:14: error: 'minj' undeclared (first use in this function); did you mean 'min'?
   59 |     c2[i]=c2[minj];
      |              ^~~~
      |              min
main.c:69:6: error: implicit declaration of function 'isStable' [-Wimplicit-function-declaration]
   69 |   is=isStable(c1,c2);
      |      ^~~~~~~~
Language: C


#include<stdio.h>
#include<stdlib.h>
 
typedef struct{
  char m;
  int v;
} card;
 
#define MAX 36
 
int N;
int isStable(c *in, c*out){
  int i;
 
  for(i=0;i<N;i++){
    if(in[i].m!=out[i].m){
      return 0;
    }
  }
 
  return 1;
}
 
int main(){
  int i,j,min,is;
  card c1[MAX],c2[MAX],t;
 
  scanf("%d",&N);
  if(N<1 || N>MAX){
    exit(1);
  }
  for(i=0;i<N;i++){
    scanf(" %c%d",&c1[i].m,&c1[i].v);
  }
 
  for(i=0;i<N;i++){
    c2[i]=c1[i];
  }
 
  for(i=0;i<N;i++){
    for(j=N-1;j>=i+1;j--){
      if(c1[j].v<c1[j-1].v){
    t=c1[j];
    c1[j]=c1[j-1];
    c1[j-1]=t;
      }
    }
  }
 
  for(i=0;i<N;i++){
    min=i;
    for(j=i;j<N;j++){
      if(c2[j].v<c2[min].v){
    min=j;
      }
    }
    t=c2[i];
    c2[i]=c2[minj];
    c2[min]=t;
  }
 
  for(i=0;i<N-1;i++){
    printf("%c%d ",c1[i].m,c1[i].v);
  }
  printf("%c%d\n",c1[N-1].m,c1[N-1].v);
  printf("Stable\n");
 
  is=isStable(c1,c2);
 
  for(i=0;i<N-1;i++){
    printf("%c%d ",c2[i].m,c2[i].v);
  }
  printf("%c%d\n",c2[N-1].m,c2[N-1].v);
  if(is==1){
    printf("Stable\n");
  }else{
    printf("Not stable\n");
  }
 
  return 0;
}
 

Compiler output:
main.c:13:14: error: unknown type name 'c'
   13 | int isStable(c *in, c*out){
      |              ^
main.c:13:21: error: unknown type name 'c'
   13 | int isStable(c *in, c*out){
      |                     ^
main.c: In function 'main':
main.c:59:14: error: 'minj' undeclared (first use in this function); did you mean 'min'?
   59 |     c2[i]=c2[minj];
      |              ^~~~
      |              min
main.c:59:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:69:6: error: implicit declaration of function 'isStable' [-Wimplicit-function-declaration]
   69 |   is=isStable(c1,c2);
      |      ^~~~~~~~
Language: C


 
 
#include<stdio.h>
#include<stdlib.h>
 
typedef struct{
  char m;
  int v;
} c;
 
#define MAX 36
 
int N;
int isStable(c *in, c*out){
  int i;
 
  for(i=0;i<N;i++){
    if(in[i].m!=out[i].m){
      return 0;
    }
  }
 
  return 1;
}
 
int main(){
  int i,j,min,is;
  c c1[MAX],c2[MAX],t;
 
  scanf("%d",&N);
  if(N<1 || N>MAX){
    exit(1);
  }
  for(i=0;i<N;i++){
    scanf(" %c%d",&c1[i].m,&c1[i].v);
  }
 
  for(i=0;i<N;i++){
    c2[i]=c1[i];
  }
 
  for(i=0;i<N;i++){
    for(j=N-1;j>=i+1;j--){
      if(c1[j].v<c1[j-1].v){
    t=c1[j];
    c1[j]=c1[j-1];
    c1[j-1]=t;
      }
    }
  }
 
  for(i=0;i<N;i++){
    min=i;
    for(j=i;j<N;j++){
      if(c2[j].v<c2[min].v){
    min=j;
      }
    }
    t=c2[i];
    c2[i]=c2[minj];
    c2[min]=t;
  }
 
  for(i=0;i<N-1;i++){
    printf("%c%d ",c1[i].m,c1[i].v);
  }
  printf("%c%d\n",c1[N-1].m,c1[N-1].v);
  printf("Stable\n");
 
  is=isStable(c1,c2);
 
  for(i=0;i<N-1;i++){
    printf("%c%d ",c2[i].m,c2[i].v);
  }
  printf("%c%d\n",c2[N-1].m,c2[N-1].v);
  if(is==1){
    printf("Stable\n");
  }else{
    printf("Not stable\n");
  }
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:61:14: error: 'minj' undeclared (first use in this function); did you mean 'min'?
   61 |     c2[i]=c2[minj];
      |              ^~~~
      |              min
main.c:61:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

void selectionSort(int A[],int n){
  int i,j,a,minj,tmp,count=0,flag;
 
  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(A[j]<A[minj]){
        minj=j;
      }
    }
    tmp = A[i];
    A[i]=A[minj];
    A[minj]=tmp;
    if(i!=minj)count++;
  }
  for(a=0;a<n;a++){
    printf("%d",A[a]);
    if(a!=n-1)printf(" ");
  }
  printf("\n%d\n",count);
}

Compiler output:
main.c: In function 'selectionSort':
main.c:17:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     printf("%d",A[a]);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | void selectionSort(int A[],int n){
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |     printf("%d",A[a]);
      |     ^~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |   printf("\n%d\n",count);
      |   ^~~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#define MAX 101

//void bubbleSort(struct Card *,int);
//void selectionSort(struct Card *, int);

struct Card{
	char number;
	char suit;
};

int main(void){
	struct Card c1[MAX],c2[MAX];
	int i,s,n,flag=1;
	
	
	scanf("%c%d",&s,&n);
	for(i=0;i<n;i++){
		scanf("%c%c",&c1[i].suit,&c1[i].number);
		c2[i].suit = c1[i].suit;
		c2[i].number = c1[i].number;
		
	}
	
	bubbleSort(c1,n);
	printf("Stable\n");
	
	selectionSort(c2,n);
	
	for(i=0;i<n;i++){
		if(c1[i].suit!=c2[i].suit){
			printf("Not stable\n");
			flag=0;
			break;
		}
	}
	if(flag==1)printf("stable\n");
	return 0;
}

void bubbleSort(struct Card *C,int n){
    int i,j,a;
    struct Card tmp;
     
    for(i=0;i<n;i++){
        for(j=n-1;j>=i+1;j--){
            if(C[j].number<C[j-1].number){
                tmp=C[j];
                C[j]=C[j-1];
                C[j-1]=tmp;
            }
        }
    }
    for(a=0;a<n;a++){
    printf("%c%d",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)print("\n");
    }
}

void selectionSort(struct Card *C,int n){
  int i,j,a,minj;
  struct Card tmp;
 
  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(C[j].number<C[minj].number){
        minj=j;
      }
    }
    tmp = C[i];
    C[i]=C[minj];
    C[minj]=tmp;
  }
  for(a=0;a<n;a++){
    if(a!=n-1)printf(" ");
    if(a==n-1)printf("\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:25:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c:28:9: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
main.c: At top level:
main.c:41:6: warning: conflicting types for 'bubbleSort'; have 'void(struct Card *, int)'
   41 | void bubbleSort(struct Card *C,int n){
      |      ^~~~~~~~~~
main.c:25:9: note: previous implicit declaration of 'bubbleSort' with type 'void(struct Card *, int)'
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:57:15: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   57 |     if(a==n-1)print("\n");
      |               ^~~~~
      |               printf
main.c: At top level:
main.c:61:6: warning: conflicting types for 'selectionSort'; have 'void(struct Card *, int)'
   61 | void selectionSort(struct Card *C,int n){
      |      ^~~~~~~~~~~~~
main.c:28:9: note: previous implicit declaration of 'selectionSort' with type 'void(struct Card *, int)'
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
Language: C

#include <stdio.h>
#define MAX 101

//void bubbleSort(struct Card *,int);
//void selectionSort(struct Card *, int);

struct Card{
	char number;
	char suit;
};

int main(void){
	struct Card c1[MAX],c2[MAX];
	int i,s,n,flag=1;
	
	
	scanf("%c%d",&s,&n);
	for(i=0;i<n;i++){
		scanf("%c%c",&c1[i].suit,&c1[i].number);
		c2[i].suit = c1[i].suit;
		c2[i].number = c1[i].number;
		
	}
	
	bubbleSort(c1,n);
	printf("Stable\n");
	
	selectionSort(c2,n);
	
	for(i=0;i<n;i++){
		if(c1[i].suit!=c2[i].suit){
			printf("Not stable\n");
			flag=0;
			break;
		}
	}
	if(flag==1)printf("stable\n");
	return 0;
}

void bubbleSort(struct Card *C,int n){
    int i,j,a;
    struct Card tmp;
     
    for(i=0;i<n;i++){
        for(j=n-1;j>=i+1;j--){
            if(C[j].number<C[j-1].number){
                tmp=C[j];
                C[j]=C[j-1];
                C[j-1]=tmp;
            }
        }
    }
    for(a=0;a<n;a++){
    printf("%c%c",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)print("\n");
    }
}

void selectionSort(struct Card *C,int n){
  int i,j,a,minj;
  struct Card tmp;
 
  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(C[j].number<C[minj].number){
        minj=j;
      }
    }
    tmp = C[i];
    C[i]=C[minj];
    C[minj]=tmp;
  }
  for(a=0;a<n;a++){
  	printf("%c%c\n",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)printf("\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:25:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c:28:9: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
main.c: At top level:
main.c:41:6: warning: conflicting types for 'bubbleSort'; have 'void(struct Card *, int)'
   41 | void bubbleSort(struct Card *C,int n){
      |      ^~~~~~~~~~
main.c:25:9: note: previous implicit declaration of 'bubbleSort' with type 'void(struct Card *, int)'
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:57:15: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   57 |     if(a==n-1)print("\n");
      |               ^~~~~
      |               printf
main.c: At top level:
main.c:61:6: warning: conflicting types for 'selectionSort'; have 'void(struct Card *, int)'
   61 | void selectionSort(struct Card *C,int n){
      |      ^~~~~~~~~~~~~
main.c:28:9: note: previous implicit declaration of 'selectionSort' with type 'void(struct Card *, int)'
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
Language: C

#include <stdio.h>
#define MAX 101

//void bubbleSort(struct Card *,int);
//void selectionSort(struct Card *, int);

struct Card{
	char number;
	char suit;
};

int main(void){
	struct Card c1[MAX],c2[MAX];
	int i,s,n,flag=1;
	char a;
	
	
	scanf("%c%d",&s,&n);
	for(i=0;i<n;i++){
		scanf("%c%c%c",&c1[i].suit,&c1[i].number,&a);
		c2[i].suit = c1[i].suit;
		c2[i].number = c1[i].number;
		
	}
	
	bubbleSort(c1,n);
	printf("Stable\n");
	
	selectionSort(c2,n);
	
	for(i=0;i<n;i++){
		if(c1[i].suit!=c2[i].suit){
			printf("Not stable\n");
			flag=0;
			break;
		}
	}
	if(flag==1)printf("stable\n");
	return 0;
}

void bubbleSort(struct Card *C,int n){
    int i,j,a;
    struct Card tmp;
     
    for(i=0;i<n;i++){
        for(j=n-1;j>=i+1;j--){
            if(C[j].number<C[j-1].number){
                tmp=C[j];
                C[j]=C[j-1];
                C[j-1]=tmp;
            }
        }
    }
    for(a=0;a<n;a++){
    printf("%c%c",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)print("\n");
    }
}

void selectionSort(struct Card *C,int n){
  int i,j,a,minj;
  struct Card tmp;
 
  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(C[j].number<C[minj].number){
        minj=j;
      }
    }
    tmp = C[i];
    C[i]=C[minj];
    C[minj]=tmp;
  }
  for(a=0;a<n;a++){
  	printf("%c%c\n",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)printf("\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   26 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c:29:9: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   29 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
main.c: At top level:
main.c:42:6: warning: conflicting types for 'bubbleSort'; have 'void(struct Card *, int)'
   42 | void bubbleSort(struct Card *C,int n){
      |      ^~~~~~~~~~
main.c:26:9: note: previous implicit declaration of 'bubbleSort' with type 'void(struct Card *, int)'
   26 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:58:15: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   58 |     if(a==n-1)print("\n");
      |               ^~~~~
      |               printf
main.c: At top level:
main.c:62:6: warning: conflicting types for 'selectionSort'; have 'void(struct Card *, int)'
   62 | void selectionSort(struct Card *C,int n){
      |      ^~~~~~~~~~~~~
main.c:29:9: note: previous implicit declaration of 'selectionSort' with type 'void(struct Card *, int)'
   29 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
Language: C

#include <stdio.h>
#define MAX 101

//void bubbleSort(struct Card *,int);
//void selectionSort(struct Card *, int);

struct Card{
	char number;
	char suit;
};

int main(void){
	struct Card c1[MAX],c2[MAX];
	char a;
	
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%c%c",&c1[i].suit,&c1[i].number);
		c2[i].suit = c1[i].suit;
		c2[i].number = c1[i].number;
		
	}
	
	bubbleSort(c1,n);
	printf("Stable\n");
	
	selectionSort(c2,n);
	
	for(i=0;i<n;i++){
		if(c1[i].suit!=c2[i].suit){
			printf("Not stable\n");
			flag=0;
			break;
		}
	}
	if(flag==1)printf("stable\n");
}

void bubbleSort(struct Card *C,int n){
    int i,j,a;
    struct Card tmp;
     
    for(i=0;i<n;i++){
        for(j=n-1;j>=i+1;j--){
            if(C[j].number<C[j-1].number){
                tmp=C[j];
                C[j]=C[j-1];
                C[j-1]=tmp;
            }
        }
    }
    for(a=0;a<n;a++){
    printf("%c%c",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)printf("\n");
    }
}

void selectionSort(struct Card *C,int n){
  int i,j,a,minj;
  struct Card tmp;
 
  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(C[j].number<C[minj].number){
        minj=j;
      }
    }
    tmp = C[i];
    C[i]=C[minj];
    C[minj]=tmp;
  }
  for(a=0;a<n;a++){
  	printf("%c%c",C[a].suit,C[a].number);
    if(a!=n-1)printf(" ");
    if(a==n-1)printf("\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:17:21: error: 'n' undeclared (first use in this function)
   17 |         scanf("%d",&n);
      |                     ^
main.c:17:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:13: error: 'i' undeclared (first use in this function)
   18 |         for(i=0;i<n;i++){
      |             ^
main.c:25:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c:28:9: error: implicit declaration of function 'selectionSort' [-Wimplicit-function-declaration]
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~
main.c:33:25: error: 'flag' undeclared (first use in this function)
   33 |                         flag=0;
      |                         ^~~~
main.c: At top level:
main.c:40:6: warning: conflicting types for 'bubbleSort'; have 'void(struct Card *, int)'
   40 | void bubbleSort(struct Card *C,int n){
      |      ^~~~~~~~~~
main.c:25:9: note: previous implicit declaration of 'bubbleSort' with type 'void(struct Card *, int)'
   25 |         bubbleSort(c1,n);
      |         ^~~~~~~~~~
main.c:60:6: warning: conflicting types for 'selectionSort'; have 'void(struct Card *, int)'
   60 | void selectionSort(struct Card *C,int n){
      |      ^~~~~~~~~~~~~
main.c:28:9: note: previous implicit declaration of 'selectionSort' with type 'void(struct Card *, int)'
   28 |         selectionSort(c2,n);
      |         ^~~~~~~~~~~~~