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

#include <stdio.h>

int main(void){
   int N, i, j, k, x, m, h, y, minj, g1, g2;

   scanf("%d", &N);

   int A[N], B[N], C1[N], C2[N], D1[N], D2[N], K1[N], K2[N], L1[N], L2[N];

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

   for(i = 0; i < N; i++) {
      D1[N] = A[N];
   }

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

   for(i = 0; i < N; i++) {
      minj = i;
      for(j = i; j < N; j++) {
         if (D1[j].value < D1[minj].value) {
            minj = j;
         }
      }
      if (minj != i) {
            x = D1[i];
            D1[i] = D1[minj];
            D1[minj] = x;
      }
   }

   g1 = 1;
   g2 = 1;


   for(i = 0; i < N; i++) {
      if (C1[i] != D1[i]) {
         g2 = 2;
      }
   }

   for(k = 0; k < N - 1; k++) {
      printf("%d ", C1[k]);
   }
   printf("%d\n", C1[N - 1]);

   if (g1 == 1) {
      printf("Stable\n");
   } else if (g1 == 2) {
      printf("Not stable\n");
   }

   for(k = 0; k < N - 1; k++) {
      printf("%d ", D1[k]);
   }
   printf("%d\n", D1[N - 1]);

   if (g2 == 1) {
      printf("Stable\n");
   } else if (g2 == 2) {
      printf("Not stable\n");
   }

   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:23:19: error: request for member 'value' in something not a structure or union
   23 |          if (C1[j].value < C1[j - 1].value) {
      |                   ^
main.c:23:37: error: request for member 'value' in something not a structure or union
   23 |          if (C1[j].value < C1[j - 1].value) {
      |                                     ^
main.c:34:19: error: request for member 'value' in something not a structure or union
   34 |          if (D1[j].value < D1[minj].value) {
      |                   ^
main.c:34:36: error: request for member 'value' in something not a structure or union
   34 |          if (D1[j].value < D1[minj].value) {
      |                                    ^
Language: C

#include <stdio.h>

int partition(int *,int,int)

int main(){
  int i,j;
  return 0;
}

int partition(int A[],int p,int r){
  int tmp;
 int  x=A[r];
 i = p-1;
 for(j=p;j<=r-1;j++){
   if(A[j]<=x){
     i++;
     tmp =A[j];
     A[j]=A[i];
     A[i]=tmp;
     }
 } tmp =A[i+1];
     A[i+1]=A[r];
     A[r]=tmp;
     return i+1;
}





Compiler output:
main.c: In function 'partition':
main.c:5:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | int main(){
      |           ^
main.c:10:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   10 | int partition(int A[],int p,int r){
      |                                   ^
main.c:29: error: expected '{' at end of input
Language: C

#include <stdio.h>
//1 行目　バブルソート
//2 安定かどうか
//3　選択ソート
//4 安定かどうか

struct typedef{
  char mark;
  int nmber;
  int mark_number;
} card;

void bubblesort(card *);
void selectionsort(card*);
int main(){
  
  card A[36];
  int i,j,n;
  scanf("%d",&n);
  for(i=-0;i<36;i++){
    scanf("%c%d",A[i].mark,&A[i].number);
    
    if(A[i].mark == 'D')A[i].mark_number == 4;
    if(A[i].mark == 'C')A[i].mark_number == 3;
    if(A[i].mark == 'H')A[i].mark_number == 2;
    if(A[i].mark == 'S')A[i].mark_number == 1;
    }

  bubblesort(A);
  selectionsort(A);
  return 0;
}

void bubblesort(card A[]){
  int minj;
  int i,A[36];
  for(i=0;i<35;i++){
    if(A[i].number>A[i+1].number){
      card tmp = A[i];
      A[i] =A[i+1];
      A[i+1]=tmp;
    }
    
    else if(A[i].number == A[i+1].number){
      //同じ番号でマークが異なる場合の処理

      
      if((A[i].mark_number > A[i+1].mark_number){
	  tmp = A[i]; 
	  A[i] =A[i+1];
	  A[i+1]=tmp;}

	else continue;
    }

    
  }i=0;
    while(i<35)printf("%c%d "A[i].mark,A[i].number);
    printf("%c%d "A[35].mark,A[35].number);
    printf("\n");
  printf("Stable\n");

}


    
 void selectionsort(card A[]){
  int i,j;
  int minj;
  
  for(i=0;i<n;i++){
	 minj = i ;
	
	for(j=i;j<n;j++){
  	if(A[j] < A[minj])minj=j;
	}
	
	card tmp = A[i];
	A[i] = A[minj];
	A[minj] ==tmp;
  }i=0;
    while(i<35)printf("%c%d "A[i].mark,A[i].number);
    printf("%c%d "A[35].mark,A[35].number);
    printf("\n");
    
    i=0;
    while(i<35){if(A[i].mark_number <= A[i+1].mark_number) printf("Stable\n");
      else printf("Not stable\n");
    }



Compiler output:
main.c:7:8: error: expected '{' before 'typedef'
    7 | struct typedef{
      |        ^~~~~~~
main.c:11:3: warning: data definition has no type or storage class
   11 | } card;
      |   ^~~~
main.c:11:3: error: type defaults to 'int' in declaration of 'card' [-Wimplicit-int]
main.c:13:17: error: expected declaration specifiers or '...' before 'card'
   13 | void bubblesort(card *);
      |                 ^~~~
main.c:14:20: error: expected declaration specifiers or '...' before 'card'
   14 | void selectionsort(card*);
      |                    ^~~~
main.c: In function 'main':
main.c:17:7: error: expected ';' before 'A'
   17 |   card A[36];
      |       ^~
      |       ;
main.c:21:18: error: 'A' undeclared (first use in this function)
   21 |     scanf("%c%d",A[i].mark,&A[i].number);
      |                  ^
main.c:21:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:3: error: implicit declaration of function 'bubblesort' [-Wimplicit-function-declaration]
   29 |   bubblesort(A);
      |   ^~~~~~~~~~
main.c:30:3: error: implicit declaration of function 'selectionsort' [-Wimplicit-function-declaration]
   30 |   selectionsort(A);
      |   ^~~~~~~~~~~~~
main.c: At top level:
main.c:34:17: error: expected declaration specifiers or '...' before 'card'
   34 | void bubblesort(card A[]){
      |                 ^~~~
main.c:67:21: error: expected declaration specifiers or '...' before 'card'
   67 |  void selectionsort(card A[]){
      |                     ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
struct CARD
{
  char suit;
  int value;
};

int main(){
  int n,i,j,minj,flag=0,t;
  struct CARD c[36],c2[36],cr,vr;
  char k;
  

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

  for(i=0; i<n; i++){
  c2[i]=c[i];
  }
  
//BubbleSort
  for(i=0; i<=n-1; i++){
    for(j=n-1; j>=i+1; j--){
      if(c[j].value<c[j-1].value){
	vr=c[j];
	c[j]=c[j-1];
	c[j-1]=vr;
      }
    }
  }

  for(i=0; i<n; i++){
    if(i)printf(" ");
    printf("%c%d",c[i].suit,c[i].value);
  }
  printf("\nStable\n");    
  
//SelectonSort
  for(i=0; i<=n; i++){
    minj=i;
    for(j=i; j<n; j++){
      if(c2[j].value<c2[minj].value){
	minj=j;
      }
    }
    cr=c2[i];
    c2[i]=c2[minj];
    c2[minj]=cr;

    /*
    for(t=0; t<n; t++){
    if(t)printf(" ");
    printf("%c%d",c2[t].suit,c2[t].value);
    }
    printf("\n");
    */
    
  }

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

  for(i=0; i<n; i++){
    if(c[i].suit!=c2[i].suit || c[i].value!=c2[i].value){
      printf("Not stable\n");
      flag=1;
      break;
    }
  }
  if(flag==0){
    printf("Stable\n");
  }
  

  return 0;



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

#include<stdio.h>

struct card
{
  char suit;
  char value;
};

void BubbleSort(struct card A[],int n)
{
  int i,j;
  struct 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(struct card  A[],int n)
{
  int i,j,minj;
  struct 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(struct card A[],int n)
{
  int i;
  for(i=0;i<n;i++)
    {
      if(i) printf(" ");
      printf("%c%c",A[i].suit,A[i].value);
    }
  printf("\n");
}

int isStable(struct card c1[],struct 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()
{
  struct card c1[101],c2[101];
  int i,n;
  char ch;

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



Compiler output:
main.c: In function 'main':
main.c:88:3: error: implicit declaration of function 'bubble' [-Wimplicit-function-declaration]
   88 |   bubble(c1,n);
      |   ^~~~~~
Language: C

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

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

void BubbleSort(AAA *, int);
void SelectionSort(AAA *, int);
void output(AAA *, int);

main main(){
  int N, i;
  AAA *C, *C_B, *C_S;
  
  scanf("%d",&N);
  C = malloc(sizeof(AAA) * N);
  C_B = malloc(sizeof(AAA) * N);
  C_S = malloc(sizeof(AAA) * N);
  for(i = 0; i < N; i++){
    scanf(" %c%d", &C[i].suit, &C[i].value);
  }
  for(i = 0; i < N; i++){
    C_B[i] = C[i];
    C_S[i] = C[i];
  }

  
  
  BubbleSort(C_B, N);
  output(C_B, N);
  printf("Stable\n");
  
  SelectionSort(C_S, N);
  output(C_S, N);
  
  for(i = 0; i < N; i++){
    if(C_B[i].suit != C_S[i].suit){
      break;
    }
  }
  if(i == N){
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }

  return 0;
}

void BubbleSort(AAA * C, int N){
  int i, j;
  AAA temp;
  for(i = 0; i < N - 1; i++){
    for(j = N - 1; j > i; j--){
      if(C[j - 1].value > C[j].value){
	temp = C[j];
	C[j] = C[j - 1];
	C[j - 1] = temp;
      }
    }
  }
}

void SelectionSort(AAA * C, int N){
  int i, j, minj, flag;
  AAA temp;

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

void output(AAA * C, int N){
  int i;
  
  for(i = 0; i < N - 1; i++){
    printf("%c%d ", C[i].suit, C[i].value);
  }
  printf("%c%d\n", C[N - 1].suit, C[N - 1].value);
}



Compiler output:
main.c:13:1: error: unknown type name 'main'
   13 | main main(){
      | ^~~~
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>
#include <string.h>
#include <ctype.h>

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

void print_array(card a[], int length)
{
    for(int i=0; i<length; i++){
        if(i==length-1)
            printf("%c%d\n", a[i].suit, a[i].value);
        else
            printf("%c%d ", a[i].suit, a[i].value);
    }
}

void swap(card *a, card *b)
{
    card temp = *a;
    *a = *b;
    *b = temp;
}

void bubble_sort(card a[], int length)
{
    //int swap_num = 0;
    for(int i=0; i<length; i++){
        //for(int j=0; j<length-i; j++){
        for(int j=length-1; j>=i+1; j--){
            if(a[j].value < a[j-1].value){
                swap(&a[j],&a[j-1]);
                swap_num++;
            }
        }
    }
    //return swap_num;
}

void selection_sort(card a[], int length)
{
    //int swap_num = 0;
    for(int i=0; i<length; i++){
        int min_i = i;
        int swap_flag = 0;
        for(int j=i; j<length; j++){
            if(a[j].value < a[min_i].value){
                min_i = j;
                swap_flag = 1;
            }
        }
        swap(&a[i], &a[min_i]);
        if(swap_flag == 1) swap_num++;
    }
    //return swap_num;
}

int main(){
    int data_length;
    card given_card[40];
    card given_card_copied[40];
    
    scanf("%d", &data_length);
    getchar();
    char get_input[200];
    fgets(get_input, sizeof(get_input), stdin);
    get_input[strlen(get_input) - 1] = '\0';
    
    int card_num = 0;
    for(int i=0; i<strlen(get_input); i++){
        if(isalpha(get_input[i])){
            given_card[card_num].suit = get_input[i];
            given_card[card_num].value = get_input[i+1] - '0';
            card_num++;
        }
        else;
    }

    for(int i=0; i<data_length; i++){
        given_card_copied[i].suit = given_card[i].suit; 
        given_card_copied[i].value = given_card[i].value;
    }

    bubble_sort(given_card_copied, data_length);
    print_array(given_card_copied, data_length);
    //printf("%d\n", swap);
    printf("Stable\n");
    
    for(int i=0; i<data_length; i++){
        given_card_copied[i].suit = given_card[i].suit; 
        given_card_copied[i].value = given_card[i].value;
    }

    bubble_sort(given_card, data_length);
    selection_sort(given_card_copied, data_length);
    print_array(given_card_copied, data_length);
    int is_stable = 1;
    for(int i=0; i<data_length; i++){
        if(given_card_copied[i].suit != given_card[i].suit){
            is_stable = 0;
        }
    }
    if(is_stable == 1) printf("Stable\n");
    else printf("Not stable\n");
}



Compiler output:
main.c: In function 'bubble_sort':
main.c:36:17: error: 'swap_num' undeclared (first use in this function)
   36 |                 swap_num++;
      |                 ^~~~~~~~
main.c:36:17: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'selection_sort':
main.c:56:28: error: 'swap_num' undeclared (first use in this function)
   56 |         if(swap_flag == 1) swap_num++;
      |                            ^~~~~~~~
Language: C

/*
    問題をよく読もう！
    論理的に考えよう！
    サンプルを確認しよう!
    絶対に諦めるな！
    工夫をしろ！
    配列は少し多めにとっておく

    Twitterは終わるまでログアウト！
    （間違えて解法をツイートしてはいけないから）

*/
//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include<cstring>
//namespace
using namespace std;
//繰り返し
#define REP(i, m, n) for(int i=(int)m; i<(int)n; ++i)
#define rep(i, n) REP(i, 0, n)
//イテレータ
#define all_range(C) begin(C), end(C)
//簡略化
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
typedef pair<string,int> pst;

const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
//最大最小
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) {if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) {if(a<b) a=b;}

//関数

//最大公約数を求める
ll my_gcd(ll x, ll y) {
  ll r;

  while(y!=0) {
    r = x%y;
    x = y;
    y = r;
  }

  return x;
}

//最小公約数を求める
ll my_lcm(ll x, ll y) {

  return (x*y)/my_gcd(x,y);
}

//xのy乗を求める ※参考：10^18乗まで
ll my_pow(ll x, ll y) {
  ll sum = 1;

  while(y>0) {
    sum *= x;
    --y;
  }

  return sum;
}

/*考えを書くスペース

*/
//main.cpp----------------------------
#define MAX 36

struct Card {
  char mark;
  int number;
};

void bubblesort(struct Card C[], int N) {

  for(int i=0; i<N-1; ++i) {
    for(int j=N-1; j>i; --j) {
      if(C[j].number<C[j-1].number) {
        swap(C[j].number, C[j-1].number);
        swap(C[j].mark, C[j-1].mark);
      }
    }
  }
}

void selectionsort(struct Card C[], int N) {

  int minj;
  for(int i=0; i<N-1; ++i) {
    minj = i;
    for(int j = i; j<N; ++j) {
      if(C[j].number<C[minj].number)
        minj = j;
    }
    swap(C[i].number, C[minj].number);
    swap(C[i].mark, C[minj].mark);
  }
}

bool isStable(struct Card in[], struct Card out[], int N) {

  for(int i=0; i<N-1; ++i) {
    for(int j=i+1; j<N-1; ++j) {
      for(int a=0; a<N-1; ++a) {
        for(int b=a+1; b<N-1; ++b) {
          if(in[i].number==in[j].number&&in[i].number==out[b].number&&in[j].number==out[a].number) {
            return false;
          }
        }
      }
    }
  }

  return true;
}

int main() {
  int n;
  struct Card B[MAX+1];
  struct Card I[MAX+1];

  cin >> n;

  rep(i, n) {
    cin >> B[i].mark >> B[i].number;
    I[i].mark = B[i].mark;
    I[i].number = B[i].number;
  }

  bubblesort(B, n);

  rep(i, n) {
    cout << B[i].mark << B[i].number;
    if(i==n-1) cout << endl;
    else cout << " ";
  }
  cout << "Stable" << endl;

  selectionsort(I, n);

  rep(i, n) {
    cout << I[i].mark << I[i].number;
    if(i==n-1) cout << endl;
    else cout << " ";
  }

  if(isStable(B, I, n)) cout << "Stable" << endl;
  else cout << "Not stable" << endl;


  return 0;
}



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

#include<stdio.h>

//構造体の定義
typedef struct {
	char suit[10];
	int value;
} Card ;

//バブルソート
void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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

//選択ソート
void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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

//バブルソートと選択ソートの結果を比較
bool isStable(Card BC[], Card SC[], int N) {
	int i;

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			return false;
		}
	}
	return true;
}

int main()
{
	int N;
	int i;
	Card BC[36];
	Card SC[36];

	scanf("%d", &N);

	for (i = 0; i < N; i++) {
		scanf("%s", BC[i].suit, 10);
		scanf("%d", &BC[i].value);
	}
	for (i = 0; i < N; i++) {
		SC[i] = BC[i];
	}

	SelectionSort(SC, N);
	BubbleSort(BC, N);

	//バブルソートの結果
	for (i = 0; i < N; i++) {
		printf("%s%d ", BC[i].suit, BC[i].value);
	}
	printf("\nStable\n");
	
	//選択ソートの結果
	for (i = 0; i < N; i++) {
		printf("%s%d ", SC[i].suit, SC[i].value);
	}
	if (isStable(BC, SC, N)) {
		printf("\nStable\n");
	}
	else {
		printf("\nNot Stable\n");
	}

	return 0;
}


Compiler output:
main.c:45:1: error: unknown type name 'bool'
   45 | bool isStable(Card BC[], Card SC[], int N) {
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'isStable':
main.c:50:32: error: 'false' undeclared (first use in this function)
   50 |                         return false;
      |                                ^~~~~
main.c:50:32: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:50:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:53:16: error: 'true' undeclared (first use in this function)
   53 |         return true;
      |                ^~~~
main.c:53:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>

//構造体の定義
typedef struct {
	char suit[10];
	int value;
} Card ;

//バブルソート
void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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

//選択ソート
void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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

//バブルソートと選択ソートの結果を比較
int isStable(Card BC[], Card SC[], int N) {
	int i;

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			return (0);
		}
	}
	return (1);
}

int main()
{
	int N;
	int i;
	Card BC[36];
	Card SC[36];
	Card C[36];

	scanf("%d", &N);

	for (i = 0; i < N; i++) {
        Card c;
        scanf("%s", C.suit);
        scanf("%d ", &C.value);
        BC[i] = c;
        SC[i] = c;
    }
	for (i = 0; i < N; i++) {
		SC[i] = BC[i];
	}

	SelectionSort(SC, N);
	BubbleSort(BC, N);

	//バブルソートの結果
	for (i = 0; i < N; i++) {
		printf("%s%d ", BC[i].suit, BC[i].value);
	}
	printf("\nStable\n");
	
	//選択ソートの結果
	for (i = 0; i < N; i++) {
		printf("%s%d ", SC[i].suit, SC[i].value);
	}
	if (isStable(BC, SC, N)) {
		printf("\nStable\n");
	}
	else {
		printf("\nNot Stable\n");
	}

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:68:22: error: '(Card *)&C' is a pointer; did you mean to use '->'?
   68 |         scanf("%s", C.suit);
      |                      ^
      |                      ->
main.c:69:24: error: '(Card *)&C' is a pointer; did you mean to use '->'?
   69 |         scanf("%d ", &C.value);
      |                        ^
      |                        ->
Language: C

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit[10];
	int value;
} Card ;


void swap_Card(Card *x, Card *y)
{
	Card temp = *x;
	*x = *y;
	*y = temp;
}

/*バブルソート*/
void BubbleSort(Card A[], int N) {
	int i, j;

	for (i = 0; i < N - 1; i++) {
		for (j = N - 1; j >= i; j--) {
			if (A[j].value < A[j - 1].value) {
				swap_Card(&A[j], &A[j - 1]);
			}
		}
	}
}


/*選択ソート*/
void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;

	for (i = 0; i < N - 1; i++) {
		minj = i;
		for (j = i + 1; j < N; j++) {
			if (A[j].value < A[minj].value) {
				minj = j;
			}
		}
		swap_Card(&A[i], &A[minj]);
	}
}


/*バブルソートと選択ソートの結果を比較*/
int isStable(Card BC[], Card SC[], int N) {
	int i;

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			return 0;
		}
	}
	return 1;
}

int main()
{
	int N;
	int i;
	Card BC[36];
	Card SC[36];

	scanf_s("%d", &N);

	for (i = 0; i < N; i++) {
		scanf_s("%s", BC[i].suit, 10);
		scanf_s("%d", &BC[i].value);
	}
	for (i = 0; i < N; i++) {
		SC[i] = BC[i];
	}

	SelectionSort(SC, N);
	BubbleSort(BC, N);

	/* Output */
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");

	return 0;
}


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

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit[10];
	int value;
} Card ;


void swap_Card(Card *x, Card *y)
{
	Card temp = *x;
	*x = *y;
	*y = temp;
}

/*バブルソート*/
void BubbleSort(Card A[], int N) {
	int i, j;

	for (i = 0; i < N - 1; i++) {
		for (j = N - 1; j >= i; j--) {
			if (A[j].value < A[j - 1].value) {
				swap_Card(&A[j], &A[j - 1]);
			}
		}
	}
}


/*選択ソート*/
void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;

	for (i = 0; i < N - 1; i++) {
		minj = i;
		for (j = i + 1; j < N; j++) {
			if (A[j].value < A[minj].value) {
				minj = j;
			}
		}
		swap_Card(&A[i], &A[minj]);
	}
}


/*バブルソートと選択ソートの結果を比較*/
int isStable(Card BC[], Card SC[], int N) {
	int i;

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			return 0;
		}
	}
	return 1;
}

int main()
{
	int N;
	scanf_s("%d\n", &N);

	int i;
	Card BC[36];
	Card SC[36];

	for (i = 0; i < N; i++) {
		Card c;
		scanf("%s", c.suit);
		scanf("%d ", &c.value);
		BC[i] = c;
		SC[i] = c;
	}

	SelectionSort(SC, N);
	BubbleSort(BC, N);

	/* Output */
	for (i = 0; i < N - 1; i++) {
		printf("%s%d ", BC[i].suit, BC[i].value);
	}
	printf("%s%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

	for (i = 0; i < N - 1; i++) {
		printf("%s%d ", SC[i].suit, SC[i].value);
	}
	printf("%s%d\n", SC[N - 1].suit, SC[N - 1].value);

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");

	return 0;
}


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

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit;
	int value;
} Card ;


void swap_Card(Card *x, Card *y)
{
	Card temp = *x;
	*x = *y;
	*y = temp;
}

/*バブルソート*/
void BubbleSort(Card A[], int N) {
	int i, j;

	for (i = 0; i < N - 1; i++) {
		for (j = N - 1; j >= i; j--) {
			if (A[j].value < A[j - 1].value) {
				swap_Card(&A[j], &A[j - 1]);
			}
		}
	}
}


/*選択ソート*/
void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;

	for (i = 0; i < N - 1; i++) {
		minj = i;
		for (j = i + 1; j < N; j++) {
			if (A[j].value < A[minj].value) {
				minj = j;
			}
		}
		swap_Card(&A[i], &A[minj]);
	}
}


int main()
{
	int N;
	scanf("%d\n", &N);

	int i,j;
	Card BC[N];
	Card SC[N];

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

	/* Bubble Sort */
    for (i = 0; i < N - 1; i++) {
        for (j = N - 1; j > i; j--) {
            if (BC[j].value < BC[j - 1].value)
                swap_Card(&BC[j], &BC[j - 1]);
        }
    }
	
	/* Selection Sort */
    for (i = 0; i < N - 1; i++) {
        int minj = i;
        for (j = i + 1; j < N; j++) {
            if (SC[j].value < SC[min_i].value)
                minj = j;
        }
        swap_Card(&SC[i], &SC[minj]);
    }
	
	/* Output */
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:77:34: error: 'min_i' undeclared (first use in this function)
   77 |             if (SC[j].value < SC[min_i].value)
      |                                  ^~~~~
main.c:77:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit;
	int value;
} Card ;


void swap_Card(Card *x, Card *y)
{
	Card temp = *x;
	*x = *y;
	*y = temp;
}


//バブルソート
void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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

//選択ソート
void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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

int main()
{
	int N;
	scanf("%d\n", &N);

	int i,j;
	Card BC[36];
	Card SC[36];

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

    
	/* 
    for (i = 0; i < N - 1; i++) {
        for (j = N - 1; j > i; j--) {
            if (BC[j].value < BC[j - 1].value)
                swap_Card(&BC[j], &BC[j - 1]);
        }
    }
	
	
    for (i = 0; i < N - 1; i++) {
        int minj = i;
        for (j = i + 1; j < N; j++) {
            if (SC[j].value < SC[minj].value)
                minj = j;
        }
        swap_Card(&SC[i], &SC[minj]);
    }
    */
    
    BubbleSort(BC,N);
    SelectionSort(SC,N);
	
	/* Output */
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");

	return 0;
}


Compiler output:
main.c: In function 'BubbleSort':
main.c:27:42: error: 'minj' undeclared (first use in this function)
   27 |                                 A[i] = A[minj];
      |                                          ^~~~
main.c:27:42: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit;
	int value;
} Card ;


void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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


void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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



int main()
{
	int N;
	int i,j;
	
	scanf("%d\n", &N);

	Card BC[36];
	Card SC[36];

    /*
	for (i = 0; i < N; i++) {
		Card c;
		scanf("%c", &c.suit);
		scanf("%d ", &c.value);
		BC[i] = c;
		SC[i] = c;
	}
	*/
	
	for (i = 0; i < N; i++) {
		scanf("%c", &c.suit);
		scanf("%d", &BC[i].value);
	}

	for (i = 0; i < N; i++) {
		SC[i] = BC[i];
	}
    
    BubbleSort(BC,N);
    SelectionSort(SC,N);
	
	/* Output */
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:67:30: error: 'c' undeclared (first use in this function)
   67 |                 scanf("%c", &c.suit);
      |                              ^
main.c:67:30: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit;
	int value;
} Card ;


void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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


void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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



int main()
{
	int N;
	int i,j;
	
	scanf("%d\n", &N);

	Card BC[36];
	Card SC[36];

    /*
	for (i = 0; i < N; i++) {
		Card c;
		scanf("%c", &c.suit);
		scanf("%d ", &c.value);
		BC[i] = c;
		SC[i] = c;
	}
	*/
	
	for (i = 0; i < N; i++) {
		scanf("%c", &BC.suit);
		scanf("%d", &BC[i].value);
	}

	for (i = 0; i < N; i++) {
		SC[i] = BC[i];
	}
    
    BubbleSort(BC,N);
    SelectionSort(SC,N);
	
	/* Output */
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:67:32: error: '(Card *)&BC' is a pointer; did you mean to use '->'?
   67 |                 scanf("%c", &BC.suit);
      |                                ^
      |                                ->
Language: C

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit;
	int value;
} Card ;


void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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


void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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

bool isStable(Card BC[], Card SC[], int N) {
	int i;

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			return false;
		}
	}
	return true;
}


int main()
{
	int N;
	int i,j;
	
	scanf("%d\n", &N);

	Card BC[36];
	Card SC[36];

	for (i = 0; i < N; i++) {
		Card c;
		scanf("%c", &c.suit);
		scanf("%d ", &c.value);
		BC[i] = c;
		SC[i] = c;
	}
	
    BubbleSort(BC,N);
    SelectionSort(SC,N);
	
	/* Output */
	/*
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");
	*/
	
	for (i = 0; i < N-1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d ", BC[N-1].suit, BC[N-1].value);
	printf("Stable\n");

	for (i = 0; i < N-1; i++) {
		printf("%c%d ", SC[i].suit, SC[i].value);
	}
	printf("%c%d ", SC[N-1].suit, SC[N-1].value);
	
	if (isStable(BC, SC, N)) {
		printf("Stable\n");
	}
	else {
		printf("Not stable\n");
	}
	
	return 0;
}


Compiler output:
main.c:44:1: error: unknown type name 'bool'
   44 | bool isStable(Card BC[], Card SC[], int N) {
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'isStable':
main.c:49:32: error: 'false' undeclared (first use in this function)
   49 |                         return false;
      |                                ^~~~~
main.c:49:32: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:49:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:52:16: error: 'true' undeclared (first use in this function)
   52 |         return true;
      |                ^~~~
main.c:52:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>

/*構造体の定義*/
typedef struct {
	char suit;
	int value;
} Card ;


void BubbleSort(Card A[], int N) {
	int i, j;
	Card temp;

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


void SelectionSort(Card A[], int N) {
	int i, j;
	int minj;
	Card temp;

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

void isStable(Card BC[], Card SC[], int N) {
	int i;

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
		    printf("Not stable\n");
			return 0;
		}
	}
	printf("Stable\n");
	return 0;
}


int main()
{
	int N;
	int i,j;
	
	scanf("%d\n", &N);

	Card BC[36];
	Card SC[36];

	for (i = 0; i < N; i++) {
		Card c;
		scanf("%c", &c.suit);
		scanf("%d ", &c.value);
		BC[i] = c;
		SC[i] = c;
	}
	
    BubbleSort(BC,N);
    SelectionSort(SC,N);
	
	/* Output */
	/*
	for (i = 0; i < N - 1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d\n", BC[N - 1].suit, BC[N - 1].value);
	puts("Stable");

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

	for (i = 0; i < N; i++) {
		if (BC[i].suit != SC[i].suit) {
			puts("Not stable");
			return 0;
		}
	}
	puts("Stable");
	*/
	
	for (i = 0; i < N-1; i++) {
		printf("%c%d ", BC[i].suit, BC[i].value);
	}
	printf("%c%d ", BC[N-1].suit, BC[N-1].value);
	printf("Stable\n");

	for (i = 0; i < N-1; i++) {
		printf("%c%d ", SC[i].suit, SC[i].value);
	}
	printf("%c%d ", SC[N-1].suit, SC[N-1].value);
	
	isStable(BC, SC, N)
	
	return 0;
}


Compiler output:
main.c: In function 'isStable':
main.c:50:32: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   50 |                         return 0;
      |                                ^
main.c:44:6: note: declared here
   44 | void isStable(Card BC[], Card SC[], int N) {
      |      ^~~~~~~~
main.c:54:16: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   54 |         return 0;
      |                ^
main.c:44:6: note: declared here
   44 | void isStable(Card BC[], Card SC[], int N) {
      |      ^~~~~~~~
main.c: In function 'main':
main.c:112:28: error: expected ';' before 'return'
  112 |         isStable(BC, SC, N)
      |                            ^
      |                            ;
  113 | 
  114 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>
#define N 36

struct kazu {
  int value;
}

main(){
  int i,j,n,a[N],b,d[N],e;
  struct kazu c;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",a[i]);
    d[i] = a[i];
  }

  for(i=0;i<n-1;i++){
    minj = i;
    for(j=n-1;j<0;j--){
      if(c[j].value < c[minj].value){
	minj = j;
      }
      b = c[j].value;
      c[j].value = c[j-1].value;
      c[minj].value = b;
    }
  }
 
  for(i=0;i<n-1;i++){
    minj = i;
    for(j=i;j<n-1;j++){
      if(c[j].value < c[minj].value){
	minj = j;
      }
      e = c[j].value;
      c[j].value = c[j-1].value;
      c[minj].value = b;
    }
  }
  return 0;
}

   

Compiler output:
main.c: In function 'main':
main.c:18:5: error: 'minj' undeclared (first use in this function)
   18 |     minj = i;
      |     ^~~~
main.c:18:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 |       if(c[j].value < c[minj].value){
      |           ^
main.c:23:12: error: subscripted value is neither array nor pointer nor vector
   23 |       b = c[j].value;
      |            ^
main.c:24:8: error: subscripted value is neither array nor pointer nor vector
   24 |       c[j].value = c[j-1].value;
      |        ^
main.c:24:21: error: subscripted value is neither array nor pointer nor vector
   24 |       c[j].value = c[j-1].value;
      |                     ^
main.c:32:11: error: subscripted value is neither array nor pointer nor vector
   32 |       if(c[j].value < c[minj].value){
      |           ^
main.c:35:12: error: subscripted value is neither array nor pointer nor vector
   35 |       e = c[j].value;
      |            ^
main.c:36:8: error: subscripted value is neither array nor pointer nor vector
   36 |       c[j].value = c[j-1].value;
      |        ^
main.c:36:21: error: subscripted value is neither array nor pointer nor vector
   36 |       c[j].value = c[j-1].value;
      |                     ^
main.c:40:10: error: incompatible types when returning type 'int' but 'struct kazu' was expected
   40 |   return 0;
      |          ^
Language: C

#include<stdio.h>
#define N 36

struct kazu {
  int value;
  char mozi;
}

main(){
  int i,j,n;
  char m;
  struct kazu a[N],d[N],b,e;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%c%d",&a[i].mozi,&a[i].value);
    d[i] = a[i];
  }

  for(i=0;i<n-1;i++){
    minj = i;
    for(j=n-1;j<i;j--){
      if(a[j].value < a[j-1].value){
	minj = j;
      }
      b = a[j];
      a[j] = a[j-1];
      a[minj] = b;
    }
  }
  
  printf("%c%d",a[0].mozi,a[0].value);
  for(i=1;i<n-1;i++){
    printf(" %c%d",a[i].mozi,a[i].value);
  }
  printf("Stable\n");
  
  
  
  
  
  
  
  for(i=0;i<n-1;i++){
    minj = i;
    for(j=i;j<n-1;j++){
      if(d[j].value < d[minj].value){
	minj = j;
      }
      e = d[j];
      d[j] = d[j-1];
      d[minj] = e;
    }
  }
  
  if()
    
    
    return 0;
}

   

Compiler output:
main.c: In function 'main':
main.c:20:5: error: 'minj' undeclared (first use in this function)
   20 |     minj = i;
      |     ^~~~
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:55:6: error: expected expression before ')' token
   55 |   if()
      |      ^
main.c:58:12: error: incompatible types when returning type 'int' but 'struct kazu' was expected
   58 |     return 0;
      |            ^
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 == chack[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:25: error: 'chack' undeclared (first use in this function); did you mean 'check'?
  117 |         if(F[i].mark == chack[j].mark) printf("Stable\n");
      |                         ^~~~~
      |                         check
main.c:117:25: note: each undeclared identifier is reported only once for each function it appears in
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");
      |                              ^