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

#include <stdio.h>

struct {
  char mark;
  int num;
} typedef Card;

void bubble(int, Card *, Card *);
void select(int, Card *, Card *);
void result(int, Card *);
void judge(int, Card *, Card *);

int main(){ 
  Card C[36] ,D[36], F[36];
  int n, x, i, j;

  scanf("%d" ,&n);
  scanf(" %c%d " ,&C[0].mark ,&C[0].num);
  for(i = 1; i < n - 1; i++) scanf("%c%d " ,&C[i].mark ,&C[i].num);
  scanf("%c%d" ,&C[n - 1].mark ,&C[n - 1].num);

  for(i = 0; i < n; i++){
    for(j = i + 1; j < n; j++){
      if(C[i].num == C[j].num){
	F[i].mark = C[i].mark;
	F[i].num = C[i].num;
      }
    }
  }

  for(i = 0; i < n; i++) D[i] = C[i];

  bubble(n, C, F);
  select(n, D, F);

  return 0;
}

void bubble(int n, Card *C, Card *F){

  char y;
  int x, i, j;

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

	y = C[i].mark;
	C[i].mark = C[i - 1].mark;
	C[i - 1].mark = y;
      }
    }
  }
 result(n, C);
 judge(n, C, F);
}

void select(int n, Card *D, Card *F){

  char y;
  int min_d, min, x, i, j;

  for(i = 0; i < n; i++){
    min_d = D[i].num;
    min = i;
    for(j = i; j < n; j++){
      if(min_d > D[j].num){
	min_d = D[j].num;
	min = j;
      }
    }
    if(i != min){
      x = D[min].num;
      D[min].num = D[i].num;
      D[i].num = x;

      y = D[min].mark;
      D[min].mark = D[i].mark;
      D[i].mark = y;
    }
  }
  result(n, D);
  judge(n, D, F);
}

void result(int n, Card *C){

  int i;

  for(i = 0; i < n - 1; i++) printf("%c%d " ,C[i].mark ,C[i].num);
  printf("%c%d\n" ,C[n - 1].mark ,C[n - 1].num);
  printf("Stable\n");
  printf("Not stable\n");

}

void judge(int n, Card *C, Card *F){

  Card check;
  int i, j;

  for(i = 0; i < n; i++){
    for(j = i + 1; j < n; j++){
      if(C[i].num == C[j].num){
	check[i]->mark = C[i].mark;
	check[i]->num = C[i].num;
      }
    }
  }

  for(i = 0; i < n; i++){
    for(j = i + 1; j < n; j++){
      if(F[i].num == check[j].num){
	if(F[i].mark == check[j].mark) printf("Stable\n");
	else printf("Not stable\n");
      }
    }
  }
 
}

Compiler output:
main.c: In function 'judge':
main.c:108:14: error: subscripted value is neither array nor pointer nor vector
  108 |         check[i]->mark = C[i].mark;
      |              ^
main.c:109:14: error: subscripted value is neither array nor pointer nor vector
  109 |         check[i]->num = C[i].num;
      |              ^
main.c:116:27: error: subscripted value is neither array nor pointer nor vector
  116 |       if(F[i].num == check[j].num){
      |                           ^
main.c:117:30: error: subscripted value is neither array nor pointer nor vector
  117 |         if(F[i].mark == check[j].mark) printf("Stable\n");
      |                              ^
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int n,i,j;
  char incard[36][3],outcardx[36][3],outcardy[36][3];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",incard[i]);
    outcardx[i]=incard[i];//strncpy
    outcardy[i]=incard[i];
  }
  //bubble
  for(i=0;i<n;i++){
    for(j=0;j<n-1;j++){
      if(outcardx[j]>outcardx[j+1]){
	swap(outcardx[j],outcardx[j+1]);
      }
    }
  }
  for(i=0;i<n;i++){
    printf("%s ",outcardx[i]);
  }
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:9:16: error: assignment to expression with array type
    9 |     outcardx[i]=incard[i];//strncpy
      |                ^
main.c:10:16: error: assignment to expression with array type
   10 |     outcardy[i]=incard[i];
      |                ^
main.c:16:9: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   16 |         swap(outcardx[j],outcardx[j+1]);
      |         ^~~~
Language: C

#include <stdio.h>
#define N 36
#define exch(a, b) {card x = a; a = b; b = x;}
#define less(a, b) (a.num < b.num)
#define compexch(a, b) {if(less(a, b))exch(a, b);}

typedef struct{
  char mark, num;
}card;

void printarr(card *a, int n){
  int i;
  for(i = 0; i < n; i++){
    printf("%c%c", a[i].mark, a[i].num);
    printf((i == n - 1) ? "" : " ");
  }
  printf("\n");
}

void selectionSort(card *a, int n){
  int i, j, min, count = 0;
  for(i = 0; i < n - 1; i++){
    min = i;
    for(j = i + 1; j < n; j++)
      if(less(a[j], a[min])) min = j;
    if(min != i) exch(a[i], a[min]);
  }
}

void bubblesort(card *a, int n){
  int i, j;
  for(i = 0; i < n - 1; i++)
    for(j = n - 1; j >= i; j--)
      compexch(a[j], a[j - 1]);
}

int comparr(card *a, card *b, int n){
  int i;
  for(i = 0; i < n; i++)
    if(a[i].mark != b[i].mark) return 0;
  return 1;
}

int main(void){
  int n, i;
  char ch;
  card bubble[N], select[N];
  scanf("%d%c", &n, &ch);
  for(i = 0; i < n; i++){
    scanf("%c%c%c", &bubble[i].mark, &bubble[i].num, &ch);
    select[i] = bubble[i];
  }
  bubblesort(bubble, n, 0);
  printarr(bubble, n);
  printf("Stable\n");
  selectionSort(select, n);
  printarr(select, n);
  printf(comparr(bubble, select, n) ? "Stable\n" : "Not stable\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:53:3: error: too many arguments to function 'bubblesort'
   53 |   bubblesort(bubble, n, 0);
      |   ^~~~~~~~~~
main.c:30:6: note: declared here
   30 | void bubblesort(card *a, int n){
      |      ^~~~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0

typedef struct tag_card {
    char suit_;
    int num_;
} card_t;

void DisplayArray(card_t C[], int N)
{
    int i;
    for (i = 0; i < N; i++) {
        if (i) printf(" ");
        printf("%c%d", C[i].suit_, C[i].num_);
    }
    printf("\n");
}

void BubbleSort(card_t C[], int N)
{
    int i, j;
    card_t tmp;

    for (i = 0; i < N - 1; i++) {
        for (j = N - 1; j >= i; j--) {
            if (C[j].num_ < C[j - 1].num_) {
                tmp = C[j];
                C[j] = C[j - 1];
                C[j - 1] = tmp;
            }
        }
    }
}

void SelectionSort(card_t C[], int N)
{
    int i, j, minj;
    card_t tmp;

    for (i = 0; i < N; i++) {
        minj = i;
        for (j = i; j < N; j++) {
            if (C[j].num_ < C[minj].num_) {
                minj = j;
            }
        }
        tmp = C[i];
        C[i] = C[minj];
        C[minj] = tmp;
    }
}

int IsStable(card_t cBubble[], card_t cSelection[], int N)
{
    int i;

    for (i = 0; i < N; i++) {
        if (cBubble[i].suit_ != cSelection[i].suit_) return FALSE;
    }

    return TRUE;
}

int main(void)
{
    int N, i, numOfExchanges;
    scanf("%d%*c", &N);
    card_t* C1 = (card_t*)malloc(sizeof(card_t) * N);
    card_t* C2 = (card_t*)malloc(sizeof(card_t) * N);

    for (i = 0; i < N; i++) {
        scanf("%c%d%*c", &C1[i].suit_, &C2[i].num_);
        C2[i].suit_ = C[i].suit_;
        C2[i].num_ = C[i].num_;
    }

    BubbleSort(C1, N);
    SelectionSort(C2, N);

    DisplayArray(C1, N);
    printf("Stable\n");
    DisplayArray(C2, 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:75:23: error: 'C' undeclared (first use in this function); did you mean 'C2'?
   75 |         C2[i].suit_ = C[i].suit_;
      |                       ^
      |                       C2
main.c:75:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define X 36
int main()
{
  int N,i,C[X];

  scanf("%d",&N);

  if(N>=1 && N<=36){
    for(i=0;i<N;i++){
      scanf("%d",&C[i]);
    }
    i=0;
    for(i=0;i<N;i++){
      minj=i;
      for(j=i;j<N;j++){ 
	if(A[j]<A[minj]){
	  minj=j;
	}
      }
      if(A[i]!=A[minj]){
	temp=A[i];
	A[i]=A[minj];
	A[minj]=temp;
	count++;
      }
    }
    for(i=0;i<N-1;i++){
      printf("%d ",A[i]);
    }
    printf("%d",A[N-1]);
    printf("\n%d\n",count);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:7: error: 'minj' undeclared (first use in this function)
   15 |       minj=i;
      |       ^~~~
main.c:15:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:11: error: 'j' undeclared (first use in this function)
   16 |       for(j=i;j<N;j++){
      |           ^
main.c:17:12: error: 'A' undeclared (first use in this function)
   17 |         if(A[j]<A[minj]){
      |            ^
main.c:22:9: error: 'temp' undeclared (first use in this function)
   22 |         temp=A[i];
      |         ^~~~
main.c:25:9: error: 'count' undeclared (first use in this function)
   25 |         count++;
      |         ^~~~~
Language: C

#include<stdio.h>
#define N 36

int main(){

  int i,j,n,min,hantei1=1,hantei2=1,a,b,cnum[N],cnum2[N],innum[N],nchange;
  char ccard[N],ccard2[N],incard[N],cchange,jud[N];


  scanf("%d",&n);
  for(i = 0;i < n;i++){
    while(1){
    scanf("%c",&ccard[i]);
    if(ccard[i] != 'S' && ccard[i] != 'H'&& ccard[i] != 'C' && ccard[i] != 'D')continue;
    scanf("%d",&cnum[i]);
    break;
    }
  }
  
  for(i = 0;i < n;i++){
    ccard2[i] = ccard[i];
    cnum2[i] = cnum[i];
    incard[i] = ccard[i];
    innum[i] = cnum[i];
  }

  for(i =0;i < n;i++){
    for(j = n-1;j > i;j--){
      if(cnum[j] < cnum[j-1]){
	cchange = ccard[j];
	nchange = cnum[j];
	ccard[j] = ccard[j-1];
	cnum[j] = cnum[j-1];
	ccard[j-1] = cchange;
	cnum[j-1] = nchange;
      }
    }
  }

  for(i = 0;i < n;i++){
    min = i;
    for(j = i;j < n;j++){
      if(cnum2[j] < cnum2[min]){
	min = j;
      }
    }
    cchange = ccard2[i];
    nchange = cnum2[i];
    ccard2[i] = ccard2[min];
    cnum2[i] = cnum2[min];
    ccard2[min] = cchange;
    cnum2[min] = nchange;
    
  }
  for(i = 0;i < n;i++){
    for(j = i+1;j< n;j++){
      if(innum[i] == innu [j]){
	jud[0] = incard[i];
	jud[1] = incard[j];
      }
    }
    for(i = 0;i < n;i++){
      for(j = i+1;j< n;j++){
	if(cnum[i] == cnum[j] && jud[0] != ccard[i]){
	  hantei1 = 0;
	}
	if(cnum2[i] == cnum2[j] && jud[0] != ccard[i]){
	  hantei2 = 0;
	}
      }
    }
    for(i = 0;i < n-1;i++){
      printf("%c%d ",ccard[i],cnum[i]);
    }
    printf("%c%d\n",ccard[n-1],cnum[n-1]);
    if(hantei1 == 0)printf("Not stable\n");
    else printf("Stable\n");


    for(i = 0;i < n-1;i++){
      printf("%c%d ",ccard2[i],cnum2[i]);
    }
    printf("%c%d\n",ccard2[n-1],cnum2[n-1]);
    if(hantei2 == 0)printf("Not stable\n");
    else printf("Stable\n");

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:57:22: error: 'innu' undeclared (first use in this function); did you mean 'innum'?
   57 |       if(innum[i] == innu [j]){
      |                      ^~~~
      |                      innum
main.c:57:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:88:1: error: expected declaration or statement at end of input
   88 | }
      | ^
Language: C

#include<stdio.h>
#define N 36

int main(){

  int i,j,n,min,hantei1=1,hantei2=1,a,b,cnum[N],cnum2[N],innum[N],nchange,k=0,l;
  char ccard[N],ccard2[N],incard[N],cchange,jud[N];


  scanf("%d",&n);
  for(i = 0;i < n;i++){
    while(1){
    scanf("%c",&ccard[i]);
    if(ccard[i] != 'S' && ccard[i] != 'H'&& ccard[i] != 'C' && ccard[i] != 'D')continue;
    scanf("%d",&cnum[i]);
    break;
    }
  }
  
  for(i = 0;i < n;i++){
    ccard2[i] = ccard[i];
    cnum2[i] = cnum[i];
    incard[i] = ccard[i];
    innum[i] = cnum[i];
  }

  for(i =0;i < n;i++){
    for(j = n-1;j > i;j--){
      if(cnum[j] < cnum[j-1]){
	cchange = ccard[j];
	nchange = cnum[j];
	ccard[j] = ccard[j-1];
	cnum[j] = cnum[j-1];
	ccard[j-1] = cchange;
	cnum[j-1] = nchange;
      }
    }
  }

  for(i = 0;i < n;i++){
    min = i;
    for(j = i;j < n;j++){
      if(cnum2[j] < cnum2[min]){
	min = j;
      }
    }
    cchange = ccard2[i];
    nchange = cnum2[i];
    ccard2[i] = ccard2[min];
    cnum2[i] = cnum2[min];
    ccard2[min] = cchange;
    cnum2[min] = nchange;
    
  }
  for(i = 0;i < n;i++){
    for(j = i+1;j< n;j++){
      if(innum[i] == innum [j]){
	jud[k] = incard[i];
	k++;
      }
    }
  }
  l = k
    for(i = 0;i < n;i++){
      for(j = i+1;j< n;j++){
	for(k = 0;k <= l;k++){
	if(cnum[i] == cnum[j] && jud[k] != ccard[i]){
	  hantei1 = 0;
	}
	if(cnum2[i] == cnum2[j] && jud[k] != ccard2[i]){
	  hantei2 = 0;
	}
	}
      }
    }
    for(i = 0;i < n-1;i++){
      printf("%c%d ",ccard[i],cnum[i]);
    }
    printf("%c%d\n",ccard[n-1],cnum[n-1]);
    if(hantei1 == 0)printf("Not stable\n");
    else printf("Stable\n");


    for(i = 0;i < n-1;i++){
      printf("%c%d ",ccard2[i],cnum2[i]);
    }
    printf("%c%d\n",ccard2[n-1],cnum2[n-1]);
    if(hantei2 == 0)printf("Not stable\n");
    else printf("Stable\n");

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:63:8: error: expected ';' before 'for'
   63 |   l = k
      |        ^
      |        ;
   64 |     for(i = 0;i < n;i++){
      |     ~~~
Language: C

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args)throws NumberFormatException,IOException{

		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String buf = br.readLine();
		int n = Integer.parseInt(buf);
			

		String[] arr = new String[n]; /*arr???????????????????????¨*/
		String[] arr1 = new String[n]; /*arr1????????¬????????§??????????????¨*/

		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader ar = new BufferedReader(is);

		String str = ar.readLine(); /*str????????????????????????????????????????????¨*/
		arr = str.split(" "); 
		arr1 = str.split(" ");
	
		
		/*??????????????????*/
		for(int i=0;i<n;i++){
			boolean bln = true;
			while(bln){
				bln = false;
			for(int j=n-1;1<=j;j--){
				if(arr[j].charAt(1)<arr[j-1].charAt(1)){
					 String temp = arr[j-1];
					arr[j-1] = arr[j];
					arr[j] = temp;
					bln = true;
				}
			}
			}
		}

		/*??¨???*/
		for(int i=0;i<n;i++){
			System.out.print(arr[i]+" ");
		}
			System.out.println("\n"+"Stable");


			/*?????¬????????§????????????*/
			for(int i=0;i<n-1;i++){
				 int minj = i;
				for(int j=i;j<n;j++){
					if(arr1[j].charAt(1)<arr1[minj].charAt(1)){
						minj = j;
					}
				}
					String temp1 = arr1[i];
					arr1[i] = arr1[minj];
					arr1[minj] = temp1;
						
			}
				
		
			/*??¨???*/
			for(int i=0;i<n;i++){
				System.out.print(arr1[i]+" ");
			}
				System.out.print("\n");

				boolean bln = true;
			/*??????*/
			for(int i=0;i<n;i++){
				if(!arr[i].equals(arr1[i])) bln = false;
			}

			if(bln)System.out.println("Stable");
			else System.out.println("Not stable");
}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.BufferedReader;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.BufferedReader;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.IOException;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.IOException;
      |            ^
main.c:3:1: error: unknown type name 'import'
    3 | import java.io.InputStreamReader;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.io.InputStreamReader;
      |            ^
main.c:5:1: error: unknown type name 'public'
    5 | public class Main{
      | ^~~~~~
main.c:5:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    5 | public class Main{
      |              ^~~~
Language: C

#include<stdio.h>
struct Card{char suit,value;};
struct Card t,C1[100],C2[100];
void bubble(struct Card A[],int N){
  int i,j;
  for( i = 0;i < N; i++){
    for(j = N - 1; j >= 0; j--){
      if(A[j].value<A[j-1].value){
	t = A[j];
	A[j] = A[j-1];
	A[j] = t;
      }
    }
  }
}

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

void print(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");
}

char isStable(){ 

int main(){

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

  return 0;

}

Compiler output:
main.c:17:16: error: unknown type name 'Card'
   17 | void selection(Card A[],int N){
      |                ^~~~
main.c:30:12: error: unknown type name 'Card'
   30 | void print(Card A[],int N){
      |            ^~~~
main.c: In function 'isStable':
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C

#include <stdio.h>

typedef struct{
  char suit;
  int value;
} Card;



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

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

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

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

int main(){
  Card i, c1[100], c2[100];
  int N;
  char ch;

  scanf("%d", &N);
  for(i=0; i<N; i++){
    scanf("%c%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,N);
  printf("Stable\n");
  print(c2,N);
  if(stable(c1,c2,N) == 1){
    printf("Stable\n");
  } else {
    printf("Not stable\n")
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:62:9: error: incompatible types when assigning to type 'Card' from type 'int'
   62 |   for(i=0; i<N; i++){
      |         ^
main.c:62:13: error: invalid operands to binary < (have 'Card' and 'int')
   62 |   for(i=0; i<N; i++){
      |             ^
main.c:62:18: error: wrong type argument to increment
   62 |   for(i=0; i<N; i++){
      |                  ^~
main.c:63:22: error: array subscript is not an integer
   63 |     scanf("%c%d", &c1[i].suit, &c1[i].value);
      |                      ^
main.c:63:35: error: array subscript is not an integer
   63 |     scanf("%c%d", &c1[i].suit, &c1[i].value);
      |                                   ^
main.c:65:9: error: incompatible types when assigning to type 'Card' from type 'int'
   65 |   for(i=0; i<N; i++) c2[i] = c1[i];
      |         ^
main.c:65:13: error: invalid operands to binary < (have 'Card' and 'int')
   65 |   for(i=0; i<N; i++) c2[i] = c1[i];
      |             ^
main.c:65:18: error: wrong type argument to increment
   65 |   for(i=0; i<N; i++) c2[i] = c1[i];
      |                  ^~
main.c:65:24: error: array subscript is not an integer
   65 |   for(i=0; i<N; i++) c2[i] = c1[i];
      |                        ^
main.c:65:32: error: array subscript is not an integer
   65 |   for(i=0; i<N; i++) c2[i] = c1[i];
      |                                ^
main.c:76:27: error: expected ';' before '}' token
   76 |     printf("Not stable\n")
      |                           ^
      |                           ;
   77 |   }
      |   ~
Language: C

#include<stdio.h>
#define N 36


typedef struct{
  int value;
  char moji;}C;


int main(){
  
  int i,j,n,flag=0,x,minj,count;
  char c;
  C C[N],M[N];
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf(" %c%d",&C[i].moji,&C[i].value);
    M[i]=C[i];}
  
  flag=1;
  i=0;
  
  while(flag){
    flag=0;
    for(j=n-1;j>=i+1;j--){
      if(C[j].value<C[j-1].value){
	x = C[j].value;
	c = C[j].moji;
        C[j].value= C[j-1].value;
	C[j].moji= C[j-1].moji;
	C[j-1].value= x;
	C[j-1].moji= c;
        flag=1; 
	count++;     
      }   
    }
    i++;  
  }

  
  for(i=0;i<n;i++){
    printf("%c%d",C[i].moji,C[i].value);}
  
  if(i==n-1)
    printf("\n");
  else
    printf(" ");
  printf("\n");
  printf("Stable\n");
   
 
  for(i=0;i<=n-1;i++){
    minj=i;
    flag=0;
    for(j=i;j<=n-1;j++){
      if(M[j].value<M[minj].value){
	minj=j;
	flag=1;
      }
    }
    if(flag==1){
      x = M[i].value;
      c = M[i].moji;
      M[i].value= M[minj].value;
      M[i].moji= M[minj].moji;
      M[minj].value= x;
      M[minj].moji= c;
      count++;
    }
  }
  for(i=0;i<n;i++){
    printf("%c%d ",M[i].moji,M[i].value);
    if(i!=n-1)
  }
  
  printf("\n");
  for(i=0;i<n;i++){
    if(C[i].moji!=M[i].moji)
      flag=1;
  }
  if(flag==1)
    printf("Not stable\n");
  else{
    printf("Stable\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:76:3: error: expected expression before '}' token
   76 |   }
      |   ^
Language: C

#include <stdio.h>

void BubbleSort(int);
void SelectionSort(int);

typedef struct{
  char mark;
  int number;
} card;

card Bubble[100];
card Select[100];
card in[100];

int main()
{
  int i,j,N,flag;

  scanf("%d",&N);

  for(i = 0;i < N;i++){
    scanf("%c",&in[i].mark);
    scanf("%d ",&in[i].number);
  }

  for(i = 0;i < N;i++){
    Bubble[i].mark = in[i].mark;
    Bubble[i].number = in[i].number;
    }

  for(i = 0;i < N;i++){
    Select[i].mark = in[i].mark;
    Select[i].number = in[i].number;
    }

  /* バブルソート */
  BubbleSort(N);


  /* 選択ソート */
  SelectionSort(N);


  /* Stable */
  /* バブルソートの安定性 */
  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(in[i].number == in[j].number &&
	     in[i].number == Select[b].number &&
	     in[j].number == Select[a].number) flag = 1; // false
	}
      }
    }
  }
  flag = 0; // true
	     

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

  printf("stable\n");

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

  if(flag == 0) printf("Not stable\n");
  else printf("Stable\n");

  return 0;
}

void BubbleSort(int N)
{
  int i,j;
  int num;
  char pic;
  card sub;

  for(i = 0;i < N;i++){
    for(j = N-1;j >= 0;j--){
      if(Bubble[j].number < Bubble[j-1].number){
       	pic = Bubble[j].mark;
	num = Bubble[j].number;
	Bubble[j].mark = Bubble[j-1].mark;
	Bubble[j].number = Bubble[j-1].number;
        Bubble[j-1].mark = pic;
	Bubble[j-1].number = num;
      }
    }
  }
}

void SelectionSort(int N)
{
  int i,j,minj;
  int num;
  char pic;

   for(i = 0;i < N;i++){
    minj = i;
    for(j = i;j < N;j++){
      if(Select[j].number < Select[minj].number){
	minj = j;
      }
      pic = Select[i].mark;
      num = Select[i].number;
      Select[i].mark = Select[minj].mark;
      Select[i].number = Select[minj].number;
      Select[minj].mark = pic;
      Select[minj].number = num;
    }
  }
}


 

Compiler output:
main.c: In function 'main':
main.c:48:11: error: 'a' undeclared (first use in this function)
   48 |       for(a = 0;a < N;a++){
      |           ^
main.c:48:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:49:13: error: 'b' undeclared (first use in this function)
   49 |         for(b = a + 1;b < N;b++){
      |             ^
Language: C

#include "stdafx.h"
#include<stdio.h>
#include<string.h>
typedef struct{ char c; int n; } card;
card B[36], S[36];
int bubble(card A[36], int N)
{
	int i, j, c = 0, flag = 1;
	card stock;
	while (flag)
	{
		flag = 0;
		for (i = N - 1; i>0; i--)
		{
			if (A[i].n<A[i - 1].n)
			{
				stock = A[i];
				A[i] = A[i - 1];
				A[i - 1] = stock;
				flag = 1;
				c++;
			}
		}
	}
	return c;
}
int selection(card A[36], int N)
{
	int i, j, d, minj, c = 0;
	card stock;
	for (i = 0; i<N; i++)
	{
		minj = i;
		for (d = 0, j = i; j<N; j++)
		{
			if (A[j].n<A[minj].n){ minj = j; d = 1; }
		}
		stock = A[i];
		A[i] = A[minj];
		A[minj] = stock;
		if (d)c++;
	}
	return c;
}
int main(void)
{
	int n, i, j;
	scanf_s("%d", &n);
	for (i = 0; i<n; i++){ scanf_s(" %c%d", &B[i].c, &B[i].n); }
	memcpy(S, B, sizeof(B));
	bubble(B, n);
	selection(S, n);
	for (i = 0; i<n; i++)
	{
		printf("%c%d", B[i].c, B[i].n);
		if (i<n - 1){ printf(" "); }
		else{ printf("\n"); }
	}
	printf("Stable\n");
	for (i = 0; i<n; i++)
	{
		printf("%c%d", S[i].c, S[i].n);
		if (i<n - 1){ printf(" "); }
		else{ printf("\n"); }
	}
	if (!memcmp(B, S, sizeof(B))){ printf("Stable\n"); }
	else{ printf("Not stable\n"); }

	return 0;
}

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


#include<stdio.h>
#include<string.h>
typedef struct{ char c; int n; } card;
card B[36], S[36];
int bubble(card A[36], int N)
{
	int i, j, c = 0, flag = 1;
	card stock;
	while (flag)
	{
		flag = 0;
		for (i = N - 1; i>0; i--)
		{
			if (A[i].n<A[i - 1].n)
			{
				stock = A[i];
				A[i] = A[i - 1];
				A[i - 1] = stock;
				flag = 1;
				c++;
			}
		}
	}
	return c;
}
int selection(card A[36], int N)
{
	int i, j, d, minj, c = 0;
	card stock;
	for (i = 0; i<N; i++)
	{
		minj = i;
		for (d = 0, j = i; j<N; j++)
		{
			if (A[j].n<A[minj].n){ minj = j; d = 1; }
		}
		stock = A[i];
		A[i] = A[minj];
		A[minj] = stock;
		if (d)c++;
	}
	return c;
}
int main(void)
{
	int n, i, j;
	scanf_s("%d", &n);
	for (i = 0; i<n; i++){ scanf_s(" %c%d", &B[i].c, &B[i].n); }
	memcpy(S, B, sizeof(B));
	bubble(B, n);
	selection(S, n);
	for (i = 0; i<n; i++)
	{
		printf("%c%d", B[i].c, B[i].n);
		if (i<n - 1){ printf(" "); }
		else{ printf("\n"); }
	}
	printf("Stable\n");
	for (i = 0; i<n; i++)
	{
		printf("%c%d", S[i].c, S[i].n);
		if (i<n - 1){ printf(" "); }
		else{ printf("\n"); }
	}
	if (!memcmp(B, S, sizeof(B))){ printf("Stable\n"); }
	else{ printf("Not stable\n"); }

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:48:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   48 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
#include<string.h>
using namespace std;

char a[100];
char c[100],c1[100],c2[100],b[100],b1[100],b2[100];

int main()
{
    int n;
    int j=0,g=0;
    int m;
    scanf("%d\n",&n);
    gets(a);
    int d=strlen(a);
    for(int i=0;i<d;i++)
    {
        if(a[i]>64)
        {
            b[j]=a[i];
            j++;
        }
        if(a[i]>47&&a[i]<58)
        {
            c[g]=a[i];
            g++;
        }
    }
    for(int i=0;i<n;i++)
    {
        c1[i]=c[i];
        b1[i]=b[i];
    }

    for(int i=n-1;i>=0;i--)
    {
        if(c1[i]<c1[i-1])
        {
            for(int g=i;g>=0;g--)
            {
                if(c1[g]<c1[g-1])
                {
                    char t=c1[g];
                    c1[g]=c1[g-1];
                    c1[g-1]=t;
                    char p=b1[g];
                    b1[g]=b1[g-1];
                    b1[g-1]=p;
                }
            }
            i=n;
        }

    }
    for(int i=0;i<n;i++)
        if(i!=n-1)
            printf("%c%c ",b1[i],c1[i]);
        else
            printf("%c%c\n",b1[i],c1[i]);
    printf("Stable\n");

    for(int i=0;i<n;i++)
    {
        c2[i]=c[i];
        b2[i]=b[i];
    }

    for(int i=0;i<n;i++)
    {
        int minv=100005;
        for(int g=i+1;g<n;g++)
        {
            if(c2[g]<minv)
            {
                minv=c2[g];
                m=g;
            }

        }
        if(c2[m]<c2[i])
        {
            char t=b2[m];
            b2[m]=b2[i];
            b2[i]=t;
            char p=c2[m];
            c2[m]=c2[i];
            c2[i]=p;
        }
    }
    for(int i=0;i<n;i++)
        if(i!=n-1)
            printf("%c%c ",b2[i],c2[i]);
        else
            printf("%c%c\n",b2[i],c2[i]);
    if(strcmp(b1,b2))
        printf("Not stable\n");
    else
        printf("stable\n");
    return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:14:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   14 |     gets(a);
      |     ^~~~
      |     fgets
Language: C

#include <stdio.h>

typedef struct{
	char suit;
	char value;
} card;

void bubble(card *p,int N);
int selection(card *p,int N);

int main(){
	card p1[50];
	card p2[50];
	int i,N;

	scanf("%d",&N);

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

	for(i=0;i<N;i++){
		p2[i]=p1[i];
	}

	bubble(p1,N);

	for(i=0;i<N;i++){
		printf("%c%c",p1[i].suit,p1[i].value);
		if(i!=N-1) printf(" ");
	}
	printf("\nStable\n");	

	int l=selection(p2,N);

	for(i=0;i<N;i++){
		printf("%c%c",p2[i].suit,p2[i].value);
		if(i!=N-1) printf(" ");
	}
	printf("\n");
	if(l==1) printf("Not Stable\n");
	else{
		printf("Stable\n");
	}

	return 0;
}

void bubble(card *p,int N){
	card key;
	int i,j;
	for(i=0;i<N;i++){
		for(j=N-1;j>i;j--){
			if(p[j].value<p[j-1].value){
				key=p[j];
				p[j]=p[j-1];
				p[j-1]=key;
			}
		}
	}
}

int selection(card *p,int N){
	card key;
	int i,j,min,f,l;
	for(i=0;i<N;i++){
		min=i;
		f=0;
		for(j=i+1;j<N;j++){
			if(p[j].value==p[min].value) f=1;
			if(p[j].value<p[min].value){
				min=j;
				if(f==1) l=1;
			}
		

Compiler output:
main.c: In function 'selection':
main.c:74:25: error: expected declaration or statement at end of input
   74 |                         }
      |                         ^
main.c:74:25: error: expected declaration or statement at end of input
main.c:74:25: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>
#include <stdlib.h>
#define swap(a, b, type) {type t; t=a; a=b; b=t;}

typedef struct {
  int num;
  char suit;
} CARD;

char getSuit(CARD *card);
int getNumber(CARD *card);
void setSuit(CARD *card, char suit);
void setNumber(CARD *card, int num);
void printCard(CARD *card);
int compCard(CARD *c1, CARD *c2);
CARD *createCard();
void deleteCard(CARD *card);

int main()
{
  int i, j, n, num, flg, min, stable;
  char suit;
  scanf("%d", &n);
  CARD **card1 = (CARD **)malloc(sizeof(CARD *) * n);
  CARD **card2 = (CARD **)malloc(sizeof(CARD *) * n);
  for(i=0; i<n; i++){
    scanf(" %c%d", &suit, &num);
    card1[i] = createCard();
    setSuit(card1[i], suit);
    setNumber(card1[i], num);
    card2[i] = createCard();
    setSuit(card2[i], suit);
    setNumber(card2[i], num);
  }

  //bubble sort
  flg=1;
  while(flg){
    flg=0;
    for(i=n-1; i>0; i--){
      int n1 = getNumber(card1[i-1]);
      int n2 = getNumber(card1[i]);
      if(n1 > n2){
        swap(card1[i-1], card1[i], CARD*);
        flg=1;
      }
    }
  }

  for(i=0; i<n; i++){
    printCard(card1[i]);
  }
  printf("\nStable\n");

  //Selection sort
  for(i=0; i<n-1; i++){
    min = i;
    for(j=i; j<n; j++){
      int n1 = getNumber(card2[min]);
      int n2 = getNumber(card2[j]);
      if(n1 > n2){
        min = j;
      }
    }
    swap(card2[i], card2[min], CARD*);
  }

  stable = 1;
  for(i=0; i<n; i++){
    printCard(card2[i]);
    if(!compCard(card1[i], card2[i])) stable = 0;
  }
  printf(stable ? "\nStable\n" : "\nNot stable\n");

  return 0;
}

char getSuit(CARD *card)
{
  return card->suit;
}
int getNumber(CARD *card)
{
  return card->num;
}

void setSuit(CARD *card, char suit)
{
  card->suit = suit;
  return;
}
int setNumber(CARD *card, int num)
{
  card->num = num;
  return;
}

void printCard(CARD *card)
{
  printf("%c%d ", getSuit(card), getNumber(card));
  return;
}

int compCard(CARD *c1, CARD *c2)
{
  if(getSuit(c1) != getSuit(c2)) return 0;
  if(getNumber(c1) != getNumber(c2)) return 0;
  return 1;
}

CARD *createCard()
{
  CARD *new;
  new = (CARD *)malloc(sizeof(CARD));
  return new;
}
void deleteCard(CARD *card)
{
  if(card != (CARD)NULL)
    free(card);
  return;
}

Compiler output:
main.c:92:5: error: conflicting types for 'setNumber'; have 'int(CARD *, int)'
   92 | int setNumber(CARD *card, int num)
      |     ^~~~~~~~~
main.c:13:6: note: previous declaration of 'setNumber' with type 'void(CARD *, int)'
   13 | void setNumber(CARD *card, int num);
      |      ^~~~~~~~~
main.c: In function 'setNumber':
main.c:95:3: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   95 |   return;
      |   ^~~~~~
main.c:92:5: note: declared here
   92 | int setNumber(CARD *card, int num)
      |     ^~~~~~~~~
main.c: In function 'deleteCard':
main.c:119:3: error: conversion to non-scalar type requested
  119 |   if(card != (CARD)NULL)
      |   ^~
Language: C

#include<stdio.h>
#include<string.h>
using namespace std;
char a[105][5];
char  b[105][5];
int q=1;
void squt(char a[],char b[]){
    char s[105];
    strcpy(s,a);
    strcpy(a,b);
    strcpy(b,s);
}

int main(){
int n;
char s;
scanf("%d%c",&n,&s);
for(int i=0;i<n;i++){
    scanf("%s",a[i]);
    strcpy(b[i],a[i]);

}

 for(int i=1 ;i<n;i++){
   for(int j=0;j<n-i;j++){
    if(a[j][1]>a[j+1][1]){
        squt(a[j],a[j+1]);
    }
   }
 }
 for(int i=0;i<n;i++){
    int m=i;
    for(int j=i;j<n;j++){
        if(b[j][1]<b[m][1]){
            m=j;
        }
    }
        squt(b[i],b[m]);

 }

 for(int i=0;q!=0&&i<n;i++){
    if(a[i][0]!=b[i][0]||a[i][1]!=b[i][1]){
        q=0;
    }

 }

for(int i=0;i<n-1;i++){
    printf("%s ",a[i]);
 }
 printf("%s",a[n-1]);
 printf("\nStable\n");
 for(int i=0;i<n-1;i++){
    printf("%s ",b[i]);
 }
 printf("%s",b[n-1]);
 if(q==0){
    printf("\nNot stable\n");
 }
 else {
  printf("\nStable\n");
 }

return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
Language: C

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

#define N 36;

typedef struct{

  char c;
  int n;

} Card;

void bubble_sort(Card*, int);
void selec_sort(Card*, int);

int main(int argc, char const *argv[]) {

  int i;
  int num;

  Card card[N],bubble[N],selec[N];

  scanf("%d",&num);

  for( i = 0 ; i < num ; i++ ){
    scanf(" %c%d",&card[i].c,&card[i].n);

    bubble[i] = selec[i] = card[i];
  }

  bubble_sort(bubble,num);
  selec_sort(selec,num);

  for( i = 0 ; i < num ; i++ ){

    if( i == num-1 ){
      printf("%c%d\n",bubble[i].c,bubble[i].n);
    }else{
      printf("%c%d ",bubble[i].c,bubble[i].n);
    }

  }

  printf("Stable\n");

  for( i = 0 ; i < num ; i++ ){

    if( i == num-1 ){
      printf("%c%d\n",selec[i].c,selec[i].n);
    }else{
      printf("%c%d ",selec[i].c,selec[i].n);
    }

  }

  for( i = 0 ; i < num ; i++ ){

    if( selec[i].c != bubble[i].c && selec[i].n == bubble[i].n ){
      printf("Not stable\n");
      return 0;
    }

  }

  printf("Stable\n");

  return 0;
}

void bubble_sort(Card *a, int n){

  int i,j;
  int tempn;
  char tempc;

  for( i = 0 ; i < n ; i++ ){
    for( j = n-1 ; j > i ; j-- ){

      if( a[j].n < a[j-1].n ){
        tempn = a[j].n;
        a[j].n = a[j-1].n;
        a[j-1].n = tempn;

        tempc = a[j].c;
        a[j].c = a[j-1].c;
        a[j-1].c = tempc;
      }

    }

  }

}

void selec_sort(Card *a, int n){

  int i,j,mini;
  int tempn;
  char tempc;

  for( i = 0 ; i < n ; i++ ){
    mini = i;
    for( j = i ; j < n ; j++ ){
      if( a[j].n < a[mini].n ){
        mini = j;
      }
    }

    if( i != mini ){
      tempn = a[i].n;
      a[i].n = a[mini].n;
      a[mini].n = tempn;

      tempc = a[i].c;
      a[i].c = a[mini].c;
      a[mini].c = tempc;
    }

  }


}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: expected ']' before ';' token
    4 | #define N 36;
      |             ^
main.c:21:13: note: in expansion of macro 'N'
   21 |   Card card[N],bubble[N],selec[N];
      |             ^
main.c:21:24: error: expected statement before ']' token
   21 |   Card card[N],bubble[N],selec[N];
      |                        ^
main.c:21:25: error: expected expression before ',' token
   21 |   Card card[N],bubble[N],selec[N];
      |                         ^
main.c:21:26: error: 'selec' undeclared (first use in this function)
   21 |   Card card[N],bubble[N],selec[N];
      |                          ^~~~~
main.c:21:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:20: error: 'card' undeclared (first use in this function); did you mean 'Card'?
   26 |     scanf(" %c%d",&card[i].c,&card[i].n);
      |                    ^~~~
      |                    Card
main.c:28:5: error: 'bubble' undeclared (first use in this function)
   28 |     bubble[i] = selec[i] = card[i];
      |     ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 36
typedef struct{
  char gara;
  int number;
}card;
void Swap(card*x,card*y){
  card temp;
  temp=*x;
  *x=*y;
  *y=temp;
}
void bubble(card *after,int n){
  int i,j;
  for(i=0;i<n;i++){
    for(j=n-1;j>i;j--){
      if(after[j].number<after[j-1].number){
	Swap(&after[j],&after[j-1]);
      }
    }
  }
}
void select(card *after,int n){
  int i,j,minj;
  for(i=0;i<n;i++){
    minj=i;
    for(j=i;j<n;j++){
      if(after[j].number<after[minj].number){
	minj=j;
      }
    }
    if(minj!=i){
      Swap(&after[i],&after[minj]);
    }
  }
}
		       
int isstable(card*x,card*y,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(x[i].number==x[j].number&&memcmp(&x[i],&y[b],sizeof(card))==0&&memcmp(&x[j],&y[a],sizeof(card))==0)
	    return -1;
	}
      }
    }
  }
  return 0;
}
int main(){
  card A[N],*after1,*after2;
  int i,j,n,judge1,judge2;
  scanf("%d",&n);
  after1=(card *)malloc(n*(sizeof(card)));
  after2=(card *)malloc(n*(sizeof(card)));
  for(i=0;i<n;i++){
    scanf(" %c%d",&A[i].gara,&A[i].number);
  }
  for(i=0;i<n;i++){
    after1[i]=A[i];
  }
  for(i=0;i<n;i++){
    after2[i]=A[i];
  }
  bubble(after1,n);
  select(after2,n);
  judge1=isstable(A,after1,n);
  judge2=isstable(A,after2,n);
  for(i=0;i<n;i++){
    printf("%c%d",after1[i].gara,after1[i].number);
    if(i!=n-1) printf(" ");
  }
  printf("\n");
  if(judge1==0||judge2==0){
    printf("stable\n");
  }
  for(i=0;i<n;i++){
    printf("%c%d",after2[i].gara,after2[i].number);
    if(i!=n-1) printf(" ");
  }
  printf("\n");
  if(judge1==-1||judge2==-1){
    printf("Not stable\n");
  }
  return 0;
}

Compiler output:
main.c:25:6: error: conflicting types for 'select'; have 'void(card *, int)'
   25 | void select(card *after,int n){
      |      ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
                 from /usr/include/stdlib.h:514,
                 from main.c:2:
/usr/include/x86_64-linux-gnu/sys/select.h:102:12: note: previous declaration of 'select' with type 'int(int,  fd_set * restrict,  fd_set * restrict,  fd_set * restrict,  struct timeval * restrict)'
  102 | extern int select (int __nfds, fd_set *__restrict __readfds,
      |            ^~~~~~
Language: C

#Include <stdio.h>
#include <stdbool.h>
#include <string.h>
typedef struct{
  char c;
  int num;
}pair;

void bubblesort(pair* , int );
void selectionsort(pair* , int);
//bool stable(pair*, pair* ,int );


int main(){

  int e,n,i,j,temp,flag = 0;
  pair box[64];
  pair in1[64];
  pair in2[64];
  char emp;

  scanf("%d\n",&n);
  printf("n = %d\n",n);

  for(i = 0;i < n;i++){
    printf("%d\n",i);
    scanf("%c",&box[i].c);
    scanf("%d",&box[i].num);
    if(i != 4) scanf("%c",&emp);
    // scanf("%c\n",&emp);

    printf("c = %c,num = %d\n",box[i].c,box[i].num);
    in1[i].c = box[i].c;
    in2[i].c = box[i].c;
    in1[i].num = box[i].num;
    in2[i].num = box[i].num;
  }

  bubblesort(in1,n);
  
  for(i = 0;i < n;i++){
    printf("%c",in1[i].c);
    printf("%d ",in1[i].num);
  }
  printf("\n");

  printf("stable\n");

  selectionsort(in2,n);


  for(i = 0;i < n;i++){
    printf("%c",in2[i].c);
    printf("%d ",in2[i].num);
  }
  printf("\n");

  for(i = 0;i < n;i++){
    if(in1[i].num != in2[i].num || in1[i].c != in2[i].c){
      flag = 1;
      break;
    }
  }
  if(flag == 0) printf("stable\n");
  else printf("not stable\n");


  return 0; 
}

void bubblesort(pair *c, int n){

  int temp,i,j;
  char tem;
  for(i = 0;i <= n - 1;i++){
    for(j = n - 1;j >= i + 1;j--){
      if(c[j].num < c[j - 1].num){
	temp = c[j].num;
	tem = c[j].c;
	c[j].num = c[j - 1].num;
	c[j].c = c[j - 1].c;
	c[j - 1].num = temp;
	c[j - 1].c = tem;
      }
    }
  }

}


void selectionsort(pair *c, int n){

  int i,j,temp,minj;
  char tem;
  for(i = 0;i <= n - 1;i++){
    minj = i;
    for(j = i;j <= n - 1 ;j++){
      if(c[j].num < c[minj].num){
	minj = j;
      }
    }
    temp = c[i].num;
    tem = c[i].c;
    c[i].num = c[minj].num;
    c[i].c = c[minj].c;
    c[minj].num = temp;
    c[minj].c = tem;
  }
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include <stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:22:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   22 |   scanf("%d\n",&n);
      |   ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    3 | #include <string.h>
  +++ |+#include <stdio.h>
    4 | typedef struct{
main.c:22:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   22 |   scanf("%d\n",&n);
      |   ^~~~~
main.c:22:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:23:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   23 |   printf("n = %d\n",n);
      |   ^~~~~~
main.c:23:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:23:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:23:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

typedef struct{
  char Mark;
  int Number;
} Card;

void SelectionSort(Card *,int);
void BubbleSort(Card *,int);
Card Kakunou(char*);

int main() {
  int i,j,k,sum,num;

  scanf("%d",&sum);

  char card[sum][2];
  Card card1[sum],BubleCard[sum],SelectCard[sum];
  for(i=0;i<sum;i++){
    scanf("%s",card[i]);
  }

  for(i=0;i<sum;i++){
    card1[i]=Kakunou(card[i]);
    BubleCard[i]=Kakunou(card[i]);
    SelectCard[i]=Kakunou(card[i]);
  }

  BubbleSort(BubleCard,sum);
  SelectSort(SelectCard,sum);

  return 0;
 
}

Card Kakunou(char A[])
{
  Card card;

  card.Mark = A[0];
  card.Number = atoi(&A[1]);

  return card;
}


void BubbleSort(Card *A,int N)
{
  int i,j,k,s,tmp1;
  char tmp2;
  for(i=0;i<N-1;i++){
    for(j=N-1;j>i+1;j--){
      if(A[j].Number < A[j-1].Number){
	tmp1 = A[j].Number;
	A[j].Number = A[j-1].Number;
	A[j-1].Number = tmp1;

	tmp2 = A[j].Mark;
	A[j].Mark = A[j-1].Mark;
	A[j-1].Mark = tmp2;
      }
    }
  }
}

  

void SelectionSort(Card *A,int N)
{
  int i,j,k,minj,num=0,tmp1;
  char tmp2;

  for(i=0;i<N;i++)
    {
      minj = i;
      for(j=i;j<N;j++)
	{
	  if(A[j].Number < A[minj].Number)
	    {
	      minj = j;
	    }
	}
      if(minj!=i)
	{
	  tmp1 = A[i].Number;
	  A[i].Number = A[minj].Number;
	  A[minj].Number = tmp1;
	 
	  tmp2 = A[j].Mark;
	  A[j].Mark = A[j-1].Mark;
	  A[j-1].Mark = tmp2;
	}
    }
}

Compiler output:
main.c: In function 'main':
main.c:31:3: error: implicit declaration of function 'SelectSort'; did you mean 'SelectionSort'? [-Wimplicit-function-declaration]
   31 |   SelectSort(SelectCard,sum);
      |   ^~~~~~~~~~
      |   SelectionSort
Language: C

#include <stdio.h>

int main() {
  int i, j, ncard, minj;
  char s, C[N];

  scanf("%d", &ncard);
  for(i=0; i<ncard; i++) scanf("%s", &C[i]);

  for(i=0; i<ncard; i++){
    for(j=0; j<ncard; j++){
      printf("%s", C[i]);
      /*  if( C[j]<C[j-1] ){
	  s = C[j];
	  C[j] = C[j-1];
	  C[j-1] = s;
	  }*/
      //}
    }
    
    /*    for( i=0 ; i<ncard ; i++ ){
	  minj = i;
	  for( j=i ; j<ncard ; j++ )
	  if( C[j]<C[mini] ) minj=j;
	  if( i<minj ){
	  s = C[i];
	  C[i] = C[minj];
	  C[minj] = s;
	  }
	  }
    */
    /* for( i=0 ; i<ncard ; i++ ){
       printf("%c", C[i]);
       if(i!=ncard-1)
       printf(" ");
       }*/
    printf("\n");
    return 0;
  }
  

Compiler output:
main.c: In function 'main':
main.c:5:13: error: 'N' undeclared (first use in this function)
    5 |   char s, C[N];
      |             ^
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:39:3: error: expected declaration or statement at end of input
   39 |   }
      |   ^
Language: C

#include <stdio.h>
#define TRUE 1
#define FALSE 0

typedef struct{
  char suit;
  char value;
} Card;

void bubble(Card *,int);
void seletion(Card *,int);
int isStable(Card *,Card *,int);

int main(){
  Card C1[100],C2[100];
  int i,n;
  char c;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%c%c",&C1[i].suit,&C1[i].value);
    C2[i] = C1[i];
  }
  bubble(C1,n);
  selection(C2,n);
  
  for(i=0;i<n;i++) printf("%c%c ",C1[i].suit,C1[i].value);
  printf("Stable\n");
  for(i=0;i<n;i++) printf("%c%c ",C2[i].suit,C2[i].value);
  if(isStable(C1,C2,n) == FALSE) printf("Not ");
  else printf("Stable\n");

  return 0;
}

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

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

int isStable(Card *c1,Card *c2,int m){
  int i,j,a,b;
  for(i=0;i<m;i++){
    for(j=i+1;j<=m;j++){
      for(a=1;a<m;a++){
	for(b=a+1;b<=m;b++){
	  if(c1[i] == c2[j] && c1[i] == c2[b] && c1[j] == c2[a]) return FALSE;
	}
      }
    }
  }
  return TRUE;
}
								  

Compiler output:
main.c: In function 'main':
main.c:25:3: error: implicit declaration of function 'selection'; did you mean 'seletion'? [-Wimplicit-function-declaration]
   25 |   selection(C2,n);
      |   ^~~~~~~~~
      |   seletion
main.c: At top level:
main.c:50:6: warning: conflicting types for 'selection'; have 'void(Card *, int)'
   50 | void selection(Card *A,int n){
      |      ^~~~~~~~~
main.c:25:3: note: previous implicit declaration of 'selection' with type 'void(Card *, int)'
   25 |   selection(C2,n);
      |   ^~~~~~~~~
main.c: In function 'isStable':
main.c:70:20: error: invalid operands to binary == (have 'Card' and 'Card')
   70 |           if(c1[i] == c2[j] && c1[i] == c2[b] && c1[j] == c2[a]) return FALSE;
      |              ~~~~~ ^~ ~~~~~
      |                |        |
      |                Card     Card
main.c:70:38: error: invalid operands to binary == (have 'Card' and 'Card')
   70 |           if(c1[i] == c2[j] && c1[i] == c2[b] && c1[j] == c2[a]) return FALSE;
      |                                ~~~~~ ^~ ~~~~~
      |                                  |        |
      |                                  Card     Card
main.c:70:56: error: invalid operands to binary == (have 'Card' and 'Card')
   70 |           if(c1[i] == c2[j] && c1[i] == c2[b] && c1[j] == c2[a]) return FALSE;
      |                                                  ~~~~~ ^~ ~~~~~
      |                                                    |        |
      |                                                    Card     Card