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

#include<stdio.h>
#include<string.h>
#define N 100
??????
typedef struct{
????char mark;
????int value;
}trump;
??
void BubbleSort(card *a,int n){
????int i,j;
????trump t;
????for(i=0;i<n;i++){
????????for(j=n-1;j>i;j--){
????????????if(a[j].value<a[j-1].value){
???????? t=a[j];
????????a[j]=a[j-1];
????????a[j-1]=t;
????????????}
????????}
????}
}

void SelectionSort(card *a,int n){
????int i,j,min;
????trump t;
????for(i=0;i<n;i++){
????????min = i;
????????for(j=i;j<n;j++){
????????????if(a[j].value<a[min].value){
????????min = j;
????????????}
????????}
????????t=a[i];
????????a[i]=a[min];
????????a[min]=t;
????}
}
??
??
int main(){
????int n, i;
????trump a1[N], a2[N];
????int flag =0;
????scanf("%d", &n);

????for(i=0;i<n;i++){
????????scanf(" %c%d",&a1[i].mark,&a1[i].value);
????}
??
????for(i=0;i<n;i++) a2[i]=a1[i];
??
????BubbleSort(a1,n);
??????
????for(i=0;i<n-1;i++) printf("%c%d ",a1[i].mark,a1[i].value);

????printf("%c%d\n",a1[n-1].mark,a1[n-1].value);
????printf("Stable\n");
??
????SelectionSort(a2,n);

????for(i=0;i<n-1;i++) printf("%c%d ",a2[i].mark,a2[i].value);

????printf("%c%d\n",a2[n-1].mark,a2[n-1].value);
??????
for(i=0;i<n;i++) if(c1[i].mark!=c2[i].mark) flag+=1;
????if(flag==0) printf("Stable\n");
????else printf("Not stable\n");
??
????return 0;
}

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??????
      | ^
main.c:8:2: warning: data definition has no type or storage class
    8 | }trump;
      |  ^~~~~
main.c:8:2: error: type defaults to 'int' in declaration of 'trump' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:24:20: error: unknown type name 'card'
   24 | void SelectionSort(card *a,int n){
      |                    ^~~~
main.c:39:1: error: expected identifier or '(' before '?' token
   39 | ??
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define N 100
??????
typedef struct{
????char mark;
????int value;
}trump;
??
void BubbleSort(trump *a,int n){
????int i,j;
????trump t;
????for(i=0;i<n;i++){
????????for(j=n-1;j>i;j--){
????????????if(a[j].value<a[j-1].value){
???????? t=a[j];
????????a[j]=a[j-1];
????????a[j-1]=t;
????????????}
????????}
????}
}

void SelectionSort(trump *a,int n){
????int i,j,min;
????trump t;
????for(i=0;i<n;i++){
????????min = i;
????????for(j=i;j<n;j++){
????????????if(a[j].value<a[min].value){
????????min = j;
????????????}
????????}
????????t=a[i];
????????a[i]=a[min];
????????a[min]=t;
????}
}
??
??
int main(){
????int n, i;
????trump a1[N], a2[N];
????int flag =0;
????scanf("%d", &n);

????for(i=0;i<n;i++){
????????scanf(" %c%d",&a1[i].mark,&a1[i].value);
????}
??
????for(i=0;i<n;i++) a2[i]=a1[i];
??
????BubbleSort(a1,n);
??????
????for(i=0;i<n-1;i++) printf("%c%d ",a1[i].mark,a1[i].value);

????printf("%c%d\n",a1[n-1].mark,a1[n-1].value);
????printf("Stable\n");
??
????SelectionSort(a2,n);

????for(i=0;i<n-1;i++) printf("%c%d ",a2[i].mark,a2[i].value);

????printf("%c%d\n",a2[n-1].mark,a2[n-1].value);
??????
for(i=0;i<n;i++) if(c1[i].mark!=c2[i].mark) flag+=1;
????if(flag==0) printf("Stable\n");
????else printf("Not stable\n");
??
????return 0;
}

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??????
      | ^
main.c:8:2: warning: data definition has no type or storage class
    8 | }trump;
      |  ^~~~~
main.c:8:2: error: type defaults to 'int' in declaration of 'trump' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:24:20: error: expected declaration specifiers or '...' before 'trump'
   24 | void SelectionSort(trump *a,int n){
      |                    ^~~~~
main.c:39:1: error: expected identifier or '(' before '?' token
   39 | ??
      | ^
Language: C

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

int isstable(int*, int*, int);

int main(){
  int i, j, p, n, min;
  int A[36], B[36], b[36];
  char q;
  char C[36], c1[36], c2[36];

  scanf("%d",&n);
  
  for(i=0 ; i<n ; i++) scanf("%c%d",&C[i],&A[i]);

  B = A;
  strcpy(C,c1);
  
  for(i=0 ; i<n ; i++){
    for(j=n-1 ; j>i ; j--){
      if(B[j] < B[j-1]){
	p = B[j];
	B[j] = B[j-1];
	B[j-1] = p;

	q = c1[j];
	c1[j] = c1[j-1];
	c1[j-1] = q;
      }
    }
  }
  
  for(i=0 ; i<n-1 ; i++) printf("%c%d ",c1[i],B[i]);
  printf("%c%d\n",c1[i],B[i]);

  if(isstable(A,B,n)) printf("Stable\n");
  else printf("Not stable");

  b = A;
  strcpy(C,c2);
  
  for(i=0 ; i<n ; i++){
    min = i;
    for(j=i ; j<n ; j++){
      if(b[j] < b[min]) min = j;
    }
    p = b[j];
    b[j] = b[j-1];
    b[j-1] = p;
    
    q = c2[j];
    c2[j] = c2[j-1];
    c2[j-1] = q;
  }
  
  for(i=0 ; i<n-1 ; i++) printf("%c%d ",c2[i],b[i]);
  printf("%c%d\n",c2[i],b[i]);
  
  if(isstable(A,B,n)) printf("Stable\n");
  else printf("Not stable");
  

  return 0;
}

int isstable(int* in, int* out, 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(in[i] == in[j] && in[i] == out[b] && in[j] == out[a]) return 0;
  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:16:5: error: assignment to expression with array type
   16 |   B = A;
      |     ^
main.c:39:5: error: assignment to expression with array type
   39 |   b = A;
      |     ^
Language: C

include<stdio.h>
#define N 36
  
typedef struct{
  char a;
  int b;
}Card;
  
int main(){
  
  int n,min,i,j;
  Card A1[N],A2[N],a;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf(" %c%d",&A1[i].a,&A1[i].b);
    A2[i]=A1[i];
  }
  
  for(i=0;i<n-1;i++){
    for(j=n-1;j>i;j--){
      if(A1[j].b<A1[j-1].b){
    a=A1[j];
    A1[j]=A1[j-1];
    A1[j-1]=a;
      }
    }
  }
  for(i=0;i<n;i++){
    printf("%c%d",A1[i].a,A1[i].b);
    if(i == n-1) break;
    printf(" ");
  }
  printf("\nStable\n");
  
  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(A2[j].b<A2[min].b){ 
    min=j;
      }    
    }
    if(i!=min){
      a=A2[i];
      A2[i]=A2[min];
      A2[min]=a;
    }
  }
  
  for(i=0;i<n;i++){
    printf("%c%d",A2[i].a,A2[i].b);
    if(i == n-1) break;
    printf(" ");
  }
  for(i=0;i<n;i++){
    if(A1[i].a!=A2[i].a){ 
      j=0; break;
    }
    else if(A1[i].a==A2[i].a) j=1;
  }
  if(j==0)  printf("\nNot stable\n");
  else if(j==1)  printf("\nStable\n");
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c:7:2: warning: data definition has no type or storage class
    7 | }Card;
      |  ^~~~
main.c:7:2: error: type defaults to 'int' in declaration of 'Card' [-Wimplicit-int]
main.c: In function 'main':
main.c:12:7: error: expected ';' before 'A1'
   12 |   Card A1[N],A2[N],a;
      |       ^~~
      |       ;
main.c:14:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   14 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:14:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   14 |   scanf("%d",&n);
      |   ^~~~~
main.c:14:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:16:20: error: 'A1' undeclared (first use in this function)
   16 |     scanf(" %c%d",&A1[i].a,&A1[i].b);
      |                    ^~
main.c:16:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:5: error: 'A2' undeclared (first use in this function)
   17 |     A2[i]=A1[i];
      |     ^~
main.c:23:5: error: 'a' undeclared (first use in this function)
   23 |     a=A1[j];
      |     ^
main.c:30:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   30 |     printf("%c%d",A1[i].a,A1[i].b);
      |     ^~~~~~
main.c:30:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:30:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:34:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   34 |   printf("\nStable\n");
      |   ^~~~~~
main.c:34:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 36

typedef struct card{
  char M; //??????????????????                                                        
  int Num;  //?????????????????°???                                                    
}Card;

void swap(Card*,Card*);
void bubbleSort(Card*,int);
void selectionSort(Card*,int);
void Printfunc(Card*,Card*,int);

int main()
{
  Card R1[N];
  Card R2[N];
  int i,j,n;
  scanf("%d",&n);
  for(i=0; i<n; i++)
    {
      scanf(" %c%d",&R1[i].M,&R1[i].Num);
      R2[i]=R1[i];
    }
  bubbleSort(R1,n);
  for(i=0; i<n; i++)
    {
      printf("%c%d",R1[i].M,R1[i].Num);
      if(i!=n-1)printf(" ");
    }
  printf("\n");
  printf("Stable\n");
  selectionSort(R2,n);
  for(i=0;i<n;i++)
    {
      printf("%c%d",R2[i].M,R2[i].Num);
      if(i!=n-1) printf(" ");
    }
printf("\n");
  Printfunc(R1, R2, n);
  return 0;
}

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].Num<a[j-1].Num) swap(&a[j],&a[j-1]);
        }
    }
}

void selectionSort(Card *a,int n)
{
  int i,j,min=0,flag=0;
  for(i=0;i<n-1;i++)
    {
      min=i;
      for(j=i;j<n;j++)
        {
          if(a[j].Num<a[min].Num)
            {
              min=j;
              flag++;
            }
        }
      if(flag)    swap(&a[i],&a[min]);
    }
}

void Printfunc(Card *a1, Card *a2, int n)
{
  int i,count=0;
  for(i=0;i<n;i++)
    {
      if(a1[i].M==a2[i].M)   count++;
    }
  if(count==n) printf("Stable\n");
  else printf("Not Stable\n");
}

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:52:14: error: 'a' undeclared (first use in this function)
   52 |           if(a[j].Num<a[j-1].Num) swap(&a[j],&a[j-1]);
      |              ^
main.c:52:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 
struct Card{
  char suit;
  char value;
};
 
struct Card C1[101], C2[101];
void trace(Card *, int);
void Bubble(Card *, int);
void Selection(Card *, int);
int main(){
  int n, i,j,mini;
  char ch;
 
  scanf("%d%c", &n, &ch);
  for ( i = 1; i <= n; i++ ){
    scanf("%c%c%c", &C1[i].suit, &C1[i].value, &ch);
    C2[i]=C1[i];
  }
 
  Bubble(C1, n);
  Selection(C2, n);
  return 0;
}


void trace(struct Card C[], int n)
{
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%c%c",C[i].suit, C[i].value);
  }
  printf("\n");
}
 
void Bubble(struct Card CB[], int n)
{
  struct Card CB2[101];
  int i,j,mini;
  for(i=0 ; i<n ; i++)
    {
      for(j=n ; j >= i+1 ; j--)
    {
      if(CB[j].value < CB[j-1].value)
        {
          CB2[j] = CB[j];
          CB[j] = CB[j-1];
          CB[j-1] = CB2[j];
        }
    }
    }
  trace(CB,n);
  printf("Stable\n");
}
 
void Selection(struct Card CS[], int n)
{
  struct Card CS2[101];
  int i,j,mini,count,flag=0;
  for(i=0 ; i<=n ; i++)
    {
      mini = i;
      count=0;
      for(j=i ; j<=n ; j++)
    {
      if(CS[j].value < CS[mini].value)
        {
          mini = j;
          count=1;
        }
    }
      if(count==1)
    {
      CS2[i] = CS[i];
      CS[i] = CS[mini];
      CS[mini] = CS2[i];
    }
      if(CS[i].suit != C1[i].suit)
    flag = 1;
    }
  trace(CS,n);
  if(flag==1)
    printf("Not stable\n");
  else printf("Stable\n");
}
 

Compiler output:
main.c:9:12: error: unknown type name 'Card'
    9 | void trace(Card *, int);
      |            ^~~~
main.c:10:13: error: unknown type name 'Card'
   10 | void Bubble(Card *, int);
      |             ^~~~
main.c:11:16: error: unknown type name 'Card'
   11 | void Selection(Card *, int);
      |                ^~~~
main.c: In function 'main':
main.c:22:3: error: implicit declaration of function 'Bubble' [-Wimplicit-function-declaration]
   22 |   Bubble(C1, n);
      |   ^~~~~~
main.c:23:3: error: implicit declaration of function 'Selection' [-Wimplicit-function-declaration]
   23 |   Selection(C2, n);
      |   ^~~~~~~~~
main.c: At top level:
main.c:38:6: warning: conflicting types for 'Bubble'; have 'void(struct Card *, int)'
   38 | void Bubble(struct Card CB[], int n)
      |      ^~~~~~
main.c:22:3: note: previous implicit declaration of 'Bubble' with type 'void(struct Card *, int)'
   22 |   Bubble(C1, n);
      |   ^~~~~~
main.c:58:6: warning: conflicting types for 'Selection'; have 'void(struct Card *, int)'
   58 | void Selection(struct Card CS[], int n)
      |      ^~~~~~~~~
main.c:23:3: note: previous implicit declaration of 'Selection' with type 'void(struct Card *, int)'
   23 |   Selection(C2, n);
      |   ^~~~~~~~~
Language: C

#include <stdio.h>
 
#define N 36
 
typedef struct{
  char suit;
  int value;
}Card;
 
int main(){
 
  int i,j,n,min,flag=0;
  Card a[N],b[N],A1,A2;
   
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf(" %c%d",&a[i].suit,&a[i].value);
    b[i].suit=a[i].suit;
    b[i].value=a[i].value;
  }
 
  for(i=0;i<n-1;i++){
    for(j=n-1;j>i;j--){
      if(a[j].value<a[j-1].value){
    A1=a[j];
    A2=a[j-1];
    a[j]=A2;
    a[j-1]=A1;
      }
    }
  }
 
     
 
  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(b[j].value<b[min].value){
    min=j;
      }
    }
    A1=b[i];
    A2=b[min];
    b[I]=A2;
    b[min]=A1;
  }
 
 
  for(i=0;i<n-1;i++){
    printf("%c%d ",a[i].suit,a[i].value);
  }
  printf("%c%d\n",a[n-1].suit,a[n-1].value);
  printf("Stable\n");
  
  for(i=0;i<n-1;i++){
    printf("%c%d ",b[i].suit,b[i].value);
  }
  printf("%c%d\n",b[n-1].suit,b[n-1].value);
    
  for(i=0;i<=n-1;i++){
    if(a[i].suit!=b[i].suit){
      flag=1;
    }
  }
  
  if(flag==1) printf("Not stable\n");
  else printf("Stable\n");
   
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:44:7: error: 'I' undeclared (first use in this function)
   44 |     b[I]=A2;
      |       ^
main.c:44:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 36
struct Card{
  char S;
  char V;
};

struct Card C1[N], C2[N];
void swap(Card*,Card*);
void trace(struct Card *, int);
void Bubblesort(struct Card *, int);
void Selectionsort(struct Card *, int);
int main()
{
  int n, i,j;
  char ch;
  scanf("%d%c",&n,&ch);
  for (i=1;i<=n;i++)
    {
      scanf("%c%c%c",&C1[i].S,&C1[i].V,&ch);
      C2[i]=C1[i];
    }
  Bubblesort(C1,n);
  Selectionsort(C2,n);
  return 0;
}
void trace(struct Card C[], int n)
{
  int i;
  for(i=1;i<=n;i++)
    {
      if (i>1) printf(" ");
      printf("%c%c",C[i].S, C[i].V);
    }
  printf("\n");
}
void Bubble(struct Card C[], int n)
{
  struct Card C[101];
  int i,j,mini;
  for(i=0;i<n;i++)
    {
      for(j=n;j>=i+1;j--)
        {
          if(CB[j].V<CB[j-1].V)
            {
              CB2[j]=CB[j];
              CB[j]=CB[j-1];
              CB[j-1] = CB2[j];
            }
        }
    }
  trace(CB,n);
  printf("Stable\n");
}
void Selection(struct Card CS[], int n)
{
  struct Card CS2[101];
  int i,j,mini,count,flag=0;
  for(i=0;i<=n;i++)
    {
      mini=i;
      count=0;
      for(j=i;j<=n;j++)
        {
          if(CS[j].V<CS[mini].V)
            {
              mini=j;
              count=1;
            }
        }
      if(count==1)
        {
          CS2[i]=CS[i];
          CS[i]=CS[mini];
          CS[mini]=CS2[i];
        }
      if(CS[i].S!=C1[i].S)      flag=1;
    }
  trace(CS,n);
  if(flag==1)
    printf("Not stable\n");
  else printf("Stable\n");
}

Compiler output:
main.c:9:11: error: unknown type name 'Card'
    9 | void swap(Card*,Card*);
      |           ^~~~
main.c:9:17: error: unknown type name 'Card'
    9 | void swap(Card*,Card*);
      |                 ^~~~
main.c: In function 'Bubble':
main.c:39:15: error: 'C' redeclared as different kind of symbol
   39 |   struct Card C[101];
      |               ^
main.c:37:25: note: previous definition of 'C' with type 'struct Card *'
   37 | void Bubble(struct Card C[], int n)
      |             ~~~~~~~~~~~~^~~
main.c:45:14: error: 'CB' undeclared (first use in this function); did you mean 'C'?
   45 |           if(CB[j].V<CB[j-1].V)
      |              ^~
      |              C
main.c:45:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:47:15: error: 'CB2' undeclared (first use in this function); did you mean 'C2'?
   47 |               CB2[j]=CB[j];
      |               ^~~
      |               C2
Language: C

        }*/
       //}
  }

  /*    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:1:9: error: expected identifier or '(' before '}' token
    1 |         }*/
      |         ^
main.c:1:11: error: expected identifier or '(' before '/' token
    1 |         }*/
      |           ^
main.c:21:10: error: expected declaration specifiers or '...' before string constant
   21 |   printf("\n");
      |          ^~~~
main.c:22:3: error: expected identifier or '(' before 'return'
   22 |   return 0;
      |   ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

#include<stdio.h>
 
struct Card{
  char suit;
  char value;
};
 
 
void BubbleSort(struct Card *A, int length) {
 
  int i, j;
  char tmp;
  char tmp1;
 
  for(i = 0; i < length; i++) {
    for(j = length-1; j > i; j--) {
      if(A[j].value < A[j-1].value) {
 
    tmp = A[j].value;
    tmp1 = A[j].suit;
 
    A[j].value = A[j-1].value;
    A[j].suit = A[j-1].suit;
 
    A[j-1].value = tmp;
    A[j-1].suit = tmp1;
 
      }
    }
  }
}
 
void SelectionSort(struct Card *A,int length) {
 
  int i, j, mini;
  char tmp;
  char tmp1;
 
  for(i = 0; i < length; i++) {
    mini = i;
    for(j = i; j < length; j++) {
      if(A[j].value < A[mini].value) {
    mini = j;
      }
    }
    if(i != mini) {
    tmp = A[i].value;
    tmp1 = A[i].suit;
 
    A[i].value = A[mini].value;
    A[i].suit = A[mini].suit;
 
    A[mini].value = tmp;
    A[mini].suit = tmp1;
 
    }
  }
}
 
 
 
int main(){
  struct Card card1[101], card2[101];
  char table[9][4]={};
  int cnt[9]={};
 
  int n, i,j,flg=0;
  char ch;
 
  scanf("%d%c", &n, &ch);
  for ( i = 0; i < n; i++ ){
    scanf("%c%c%c", &card1[i].suit, &card1[i].value, &ch);
    table[card1[i].value-'1'][cnt[card1[i].value-'1']]=card1[i].suit;
    cnt[card1[i].value-'1']++;
  }
  for(i = 0; i < n; i++) {
 
    card2[i].suit = card1[i].suit;
    card2[i].value = card1[i].value;
  }
 
  BubbleSort(C1, n);
  SelectionSort(C2, n);
 
 
  for(i=0;i<9;i++)cnt[i]=0;
 
  if(table[card1[0].value-'1'][cnt[card1[0].value-'1']++]!=card1[0].suit)
    {
      flg=1;
    }
  printf("%c%c", card1[0].suit, card1[0].value);
  for(i = 1; i < n; i++) {
  if(table[card1[i].value-'1'][cnt[card1[i].value-'1']++]!=card1[i].suit)
    {
      flg=1;
    }
  printf(" %c%c?\n", card1[i].suit, card1[i].value);
  }
 
  if(flg==0)
    printf("Stable\n");
  else
    printf("Not stable\n");
 
  for(i=0;i<9;i++)cnt[i]=0;
  flg=0;
 
  if(table[card2[0].value-'1'][cnt[card2[0].value-'1']++]!=card2[0].suit)
    {
      flg=1;
    }
 
 
 printf("%c%c", card2[0].suit, card2[0].value);
  for(i = 1; i < n; i++) {
  if(table[card1[i].value-'1'][cnt[C1[i].value-'1']++]!=card2[i].suit)
    {
      flg=1;
    }
  printf(" %c%c", card2[i].suit, card2[i].value);
  }
 
  if(flg==0)
    printf("\nStable\n");
  else
    printf("\nNot stable\n");
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:82:14: error: 'C1' undeclared (first use in this function)
   82 |   BubbleSort(C1, n);
      |              ^~
main.c:82:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:83:17: error: 'C2' undeclared (first use in this function)
   83 |   SelectionSort(C2, n);
      |                 ^~
Language: C

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

void change(int n,int m,char s,char t)
{
 int l;
 char r;

 l=n;
 n=m;
 m=l;

 r=s;
 s=t;
 t=r;

}

void print(int a[],int N)
{
 int i;

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

}

struct card {
    char mark;
    int  num;
};

int main(void)
{
 int N,i,j,k,l,min;
 struct card a[36],b[36];

 scanf("%d",&N);

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

 for(i=0;i<N-1;i++){
  for(j=N-1;j<i+1;j--){
   if(a[j].num<a[j-1].num){
     change(a[j].num,a[j-1].num,a[j].mark,a[j-1].mark);
   }
  }
 }

 for(i=0;i<N;i++){
  b[i]=a[i];
 }

 print(a,N);
 printf("Stable\n");

 for(i=0;i<N-1;i++){

  min=i;
  for(j=i;j<N;j++){

   if(a[j]<a[min]){
    min=j;
   }
   change(a[i].num,a[min].num,a[i].mark,a[min].mark);

  }
 }

 print(a,N);
 for(i=0;i<N;i++){
  if(a[i].num==b[i].num&&a[i].mark!=b[i]){
   printf("Not stable\n");
  }else{
   printf("Stable\n");
  }
 }

 return 0;

}

Compiler output:
main.c: In function 'print':
main.c:24:22: error: request for member 'mark' in something not a structure or union
   24 |   printf("%c%d ",a[i].mark,a[i].num);
      |                      ^
main.c:24:32: error: request for member 'num' in something not a structure or union
   24 |   printf("%c%d ",a[i].mark,a[i].num);
      |                                ^
main.c:26:24: error: request for member 'mark' in something not a structure or union
   26 |  printf("%c%d\n",a[N-1].mark,a[N-1].num);
      |                        ^
main.c:26:36: error: request for member 'num' in something not a structure or union
   26 |  printf("%c%d\n",a[N-1].mark,a[N-1].num);
      |                                    ^
main.c: In function 'main':
main.c:58:8: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
   58 |  print(a,N);
      |        ^
      |        |
      |        struct card *
main.c:19:16: note: expected 'int *' but argument is of type 'struct card *'
   19 | void print(int a[],int N)
      |            ~~~~^~~
main.c:66:11: error: invalid operands to binary < (have 'struct card' and 'struct card')
   66 |    if(a[j]<a[min]){
      |       ~~~~^~~~~~~
      |        |    |
      |        |    struct card
      |        struct card
main.c:74:8: error: passing argument 1 of 'print' from incompatible pointer type [-Wincompatible-pointer-types]
   74 |  print(a,N);
      |        ^
      |        |
      |        struct card *
main.c:19:16: note: expected 'int *' but argument is of type 'struct card *'
   19 | void print(int a[],int N)
      |            ~~~~^~~
main.c:76:35: error: invalid operands to binary != (have 'int' and 'struct card')
   76 |   if(a[i].num==b[i].num&&a[i].mark!=b[i]){
      |                          ~~~~~~~~~^~~~~~
      |                              |       |
      |                              char    struct card
Language: C

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

void change(int n,int m,char s,char t)
{
 int l;
 char r;

 l=n;
 n=m;
 m=l;

 r=s;
 s=t;
 t=r;

}

struct card {
    char mark;
    int  num;
};

int main(void)
{
 int N,i,j,k,l,min;
 struct card a[36],b[36];

 scanf("%d",&N);

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

 for(i=0;i<N-1;i++){
  for(j=N-1;j<i+1;j--){
   if(a[j].num<a[j-1].num){
     change(a[j].num,a[j-1].num,a[j].mark,a[j-1].mark);
   }
  }
 }

 for(i=0;i<N;i++){
  b[i]=a[i];
 }

 for(i=0;i<N-1;i++){
  printf("%c%d ",a[i].mark,a[i].num);
 }
 printf("%c%d\n",a[N-1].mark,a[N-1].num);
 printf("Stable\n");

 for(i=0;i<N-1;i++){

  min=i;
  for(j=i;j<N;j++){

   if(a[j]<a[min]){
    min=j;
   }
   change(a[i].num,a[min].num,a[i].mark,a[min].mark);

  }
 }

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

 for(i=0;i<N;i++){
  if(a[i].num==b[i].num&&a[i].mark!=b[i]){
   printf("Not stable\n");
  }else{
   printf("Stable\n");
  }
 }

 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:58:11: error: invalid operands to binary < (have 'struct card' and 'struct card')
   58 |    if(a[j]<a[min]){
      |       ~~~~^~~~~~~
      |        |    |
      |        |    struct card
      |        struct card
main.c:72:35: error: invalid operands to binary != (have 'int' and 'struct card')
   72 |   if(a[i].num==b[i].num&&a[i].mark!=b[i]){
      |                          ~~~~~~~~~^~~~~~
      |                              |       |
      |                              char    struct card
Language: C

#include<stdio.h>
 
void Bubble(int a[36],char b[36],n)
{
  int i,tempa,flag;
  char tempb;
  flag = 1;
  while(flag == 1) {
  flag=0;
  for (i =n-2; i >=0;i--) {
    if(a[i]>a[i+1]){
      tempa = a[i+1];
      tempb = b[i+1];
      a[i+1] = a[i];
      b[i+1] = b[i];
      a[i] = tempa;
      b[i] = tempb;
      flag = 1;
    }
  }
  }
  for(i = 0; i<n-1;i++)
    printf("%c%d ",b[i],a[i]);
  printf("%c%d\n",b[n-1],a[n-1]);
  printf("Stable\n");
}
 

void Selection(int a[36],char[36],n)
{
  int i,mini,temp,j;
  for (i = 0; i < n; i++) {
    mini = i;
    for (j = i; j < n; j++) {
      if(a[mini] > a[j])
        mini = j;
    }
    if(mini != i){
      tempa = a[i];
      tempb = b[i];
      a[i] = a[mini];
      b[i] = b[mini];
      a[mini] = tempa;
      b[mini] = tempb;
    }  
   }
  for (i = 0; i < n-1; i++)
  printf("%c%d ",b[i],a[i]);
  printf("%c%d\n"b[n-1],a[n-1]);
}

void Stable(char b1[36],char b2[36],n){
  int i,flag = 0;
  for(i = 0;i < n ;i++){
    if(b1[i]!=b2[i]) {
      printf("Not stable\n");
      flag = 1
      break;
    }
  }
  if(flag == 0)
    printf("Stable\n");  
}

int main ()
{
 int a1[36],a2[36],n,num=0;
 char b1[36],b2[36];
 scanf("%d",&n);
 for (i = 0; i < n; i++) 
  scanf("%c%d",&b[i],&a[i]);
 for (i = 0; i < n; i++) {
  a2[i]=a1[i];
  b2[i]=b1[i];
 }
 Bubble(a1,b1,n);
 Selection(a2,b2,n);
 Stable(b1,b2,n);
 return 0;
}

Compiler output:
main.c:3:34: error: unknown type name 'n'
    3 | void Bubble(int a[36],char b[36],n)
      |                                  ^
main.c:29:35: error: unknown type name 'n'
   29 | void Selection(int a[36],char[36],n)
      |                                   ^
main.c:52:37: error: unknown type name 'n'
   52 | void Stable(char b1[36],char b2[36],n){
      |                                     ^
main.c: In function 'main':
main.c:70:7: error: 'i' undeclared (first use in this function)
   70 |  for (i = 0; i < n; i++)
      |       ^
main.c:70:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:71:17: error: 'b' undeclared (first use in this function); did you mean 'b2'?
   71 |   scanf("%c%d",&b[i],&a[i]);
      |                 ^
      |                 b2
main.c:71:23: error: 'a' undeclared (first use in this function)
   71 |   scanf("%c%d",&b[i],&a[i]);
      |                       ^
main.c:76:2: error: implicit declaration of function 'Bubble' [-Wimplicit-function-declaration]
   76 |  Bubble(a1,b1,n);
      |  ^~~~~~
main.c:77:2: error: implicit declaration of function 'Selection' [-Wimplicit-function-declaration]
   77 |  Selection(a2,b2,n);
      |  ^~~~~~~~~
main.c:78:2: error: implicit declaration of function 'Stable' [-Wimplicit-function-declaration]
   78 |  Stable(b1,b2,n);
      |  ^~~~~~
Language: C

#include<stdio.h>

struct Card{
   char suit;
   char value;
};

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

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

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

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

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

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

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

   return 0;
}

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

#include<stdio.h>

struct Card{
   char suit;
   char value;
};

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

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

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

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

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

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

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

   return 0;
}

Compiler output:
main.c: In function 'selectionSort':
main.c:35:18: error: invalid operands to binary < (have 'struct Card' and 'struct Card')
   35 |          if (A[j]<A[minj])
      |              ~~~~^~~~~~~~
      |               |    |
      |               |    struct Card
      |               struct Card
main.c: In function 'main':
main.c:57:47: error: expected ';' before 'C2'
   57 |       scanf("%c%c", &C1[i].suit, &C1[i].value)
      |                                               ^
      |                                               ;
   58 |       C2[i].suit = C1[i].suit;
      |       ~~
Language: C

#include<stdio.h>

struct Card{
   char suit;
   char value;
};

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

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

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

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

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

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

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

   return 0;
}

Compiler output:
main.c: In function 'selectionSort':
main.c:35:18: error: invalid operands to binary < (have 'struct Card' and 'struct Card')
   35 |          if (A[j]<A[minj])
      |              ~~~~^~~~~~~~
      |               |    |
      |               |    struct Card
      |               struct Card
main.c: In function 'main':
main.c:57:47: error: expected ';' before 'C2'
   57 |       scanf("%c%c", &C1[i].suit, &C1[i].value)
      |                                               ^
      |                                               ;
   58 |       C2[i].suit = C1[i].suit;
      |       ~~
Language: C

#include <stdio.h>

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

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

int isStable(int a[],int b[],int N){
  int i;
  for(i=0;i<N;i++){
    if(a[i]!=b[i].){
      return false;
    }
  return true;
}

int main(void)
{
  int i,N,a[100],b[100];
  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
    scanf("%d",&b[i]);
    b[i]=a[i]
  }
  bubble(a[],N);
  select(b[],N);

  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("%d\n");
  
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",b[i]);
  }
  printf("%d\n");

  if(isStable(a[],b[],N)){
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }
  return 0;
}


  

    

Compiler output:
main.c: In function 'isStable':
main.c:36:19: error: expected identifier before ')' token
   36 |     if(a[i]!=b[i].){
      |                   ^
main.c:37:14: error: 'false' undeclared (first use in this function)
   37 |       return false;
      |              ^~~~~
main.c:2:1: note: 'false' 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:37:14: note: each undeclared identifier is reported only once for each function it appears in
   37 |       return false;
      |              ^~~~~
main.c:39:10: error: 'true' undeclared (first use in this function)
   39 |   return true;
      |          ^~~~
main.c:39:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:50:14: error: expected ';' before '}' token
   50 |     b[i]=a[i]
      |              ^
      |              ;
   51 |   }
      |   ~           
main.c:52:12: error: expected expression before ']' token
   52 |   bubble(a[],N);
      |            ^
main.c:53:12: error: expected expression before ']' token
   53 |   select(b[],N);
      |            ^
main.c:71:17: error: expected expression before ']' token
   71 |   if(isStable(a[],b[],N)){
      |                 ^
main.c: In function 'isStable':
main.c:78:1: error: expected declaration or statement at end of input
   78 | }
      | ^
Language: C

#include <stdio.h>
??
int bubble(int a[],int N){
????int i,j,z;
????z=0;
????for(i=0;i<N;i++){
????????for(j=N-1;j>=i+1;j--){
????????????if(a[j]<a[j-1]){
????????????????????z=a[j-1];
????????????????????a[j-1]=a[j];
????????????????????a[j]=z;
????????????}
????????}
????}
}
??
int select(int b[],int N){
????int i,j,s,z,minj;
????z=0;
????for(i=0;i<N-1;i++){
????????minj=i;
????????for(j=i;j<N;j++){
????????????if(b[j]<b[minj]){
????????????????minj=j;
????????????}
????????}
????????z=b[i];
????????b[i]=b[minj];
????????b[minj]=z;
????}
}
??
int isStable(int a[],int b[],int N){
????int i;
????for(i=0;i<N;i++){
????????if(a[i]!=b[i]){
????????????return false;
????????}
????return true;
}
??
int main(void)
{
????int i,N,a[100],b[100];
????scanf("%d",&N);
??????
????for(i=0;i<N;i++){
????????scanf("%d",&a[i]);
????????scanf("%d",&b[i]);
????????b[i]=a[i]
????}
????bubble(a[],N);
????select(b[],N);
??
????for(i=0;i<N;i++){
????????if(i>0){
????????????printf(" ");
????????}
????????printf("%d",a[i]);
????}
????printf("%d\n");
??????
????for(i=0;i<N;i++){
????????if(i>0){
????????????printf(" ");
????????}
????????printf("%d",b[i]);
????}
????printf("%d\n");
??
????if(isStable(a[],b[],N)){
????????printf("Stable\n");
????}
????else{
????????printf("Not stable\n");
????}
????return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:16:1: error: expected identifier or '(' before '?' token
   16 | ??
      | ^
main.c:32:1: error: expected identifier or '(' before '?' token
   32 | ??
      | ^
Language: C

#include <stdio.h>

int bubble(int a[],int N){
  int i,j,z;
  z=0;
  for(i=0;i<N;i++){
    for(j=N-1;j>=i+1;j--){
      if(a[j]<a[j-1]){
        z=a[j-1];
        a[j-1]=a[j];
        a[j]=z;
      }
    }
  }
}
??
int select(int b[],int N){
  int i,j,s,z,minj;
  z=0;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(b[j]<b[minj]){
        minj=j;
      }
    }
    z=b[i];
    b[i]=b[minj];
    b[minj]=z;
  }
}

int isStable(int a[],int b[],int N){
  int i;
  for(i=0;i<N;i++){
    if(a[i]!=b[i]){
      return false;
    }
  return true;
}

int main(void)
{
  int i,N,a[100],b[100];
  scanf("%d",&N);
??
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
    scanf("%d",&b[i]);
    b[i]=a[i]
  }
  bubble(a[],N);
  select(b[],N);

  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("%d\n");
??
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",b[i]);
  }
  printf("%d\n");

  if(isStable(a[],b[],N)){
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }
  return 0;
}

Compiler output:
main.c:16:1: error: expected identifier or '(' before '?' token
   16 | ??
      | ^
main.c: In function 'isStable':
main.c:37:14: error: 'false' undeclared (first use in this function)
   37 |       return false;
      |              ^~~~~
main.c:2:1: note: 'false' 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:37:14: note: each undeclared identifier is reported only once for each function it appears in
   37 |       return false;
      |              ^~~~~
main.c:39:10: error: 'true' undeclared (first use in this function)
   39 |   return true;
      |          ^~~~
main.c:39:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:46:1: error: expected expression before '?' token
   46 | ??
      | ^
main.c:53:3: error: implicit declaration of function 'select' [-Wimplicit-function-declaration]
   53 |   select(b[],N);
      |   ^~~~~~
main.c:53:12: error: expected expression before ']' token
   53 |   select(b[],N);
      |            ^
main.c:62:1: error: expected expression before '?' token
   62 | ??
      | ^
main.c:71:17: error: expected expression before ']' token
   71 |   if(isStable(a[],b[],N)){
      |                 ^
main.c: In function 'isStable':
main.c:78:1: error: expected declaration or statement at end of input
   78 | }
      | ^
Language: C

#include <stdio.h>

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

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

int isStable(int a[],int b[],int N){
  int i;
  for(i=0;i<N;i++){
    if(a[i]!=b[i].){
      return false;
    }
  return true;
}

int main(void)
{
  int i,N,a[100],b[100];
  scanf("%d",&N);
  ??
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
    scanf("%d",&b[i]);
    b[i]=a[i]
  }
  bubble(a[],N);
  select(b[],N);
  
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("%d\n");
??
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",b[i]);
  }
  printf("%d\n");
  
  if(isStable(a[],b[],N)){
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'isStable':
main.c:36:19: error: expected identifier before ')' token
   36 |     if(a[i]!=b[i].){
      |                   ^
main.c:37:14: error: 'false' undeclared (first use in this function)
   37 |       return false;
      |              ^~~~~
main.c:2:1: note: 'false' 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:37:14: note: each undeclared identifier is reported only once for each function it appears in
   37 |       return false;
      |              ^~~~~
main.c:39:10: error: 'true' undeclared (first use in this function)
   39 |   return true;
      |          ^~~~
main.c:39:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:46:3: error: expected expression before '?' token
   46 |   ??
      |   ^
main.c:53:12: error: expected expression before ']' token
   53 |   select(b[],N);
      |            ^
main.c:62:1: error: expected expression before '?' token
   62 | ??
      | ^
main.c:71:17: error: expected expression before ']' token
   71 |   if(isStable(a[],b[],N)){
      |                 ^
main.c: In function 'isStable':
main.c:78:1: error: expected declaration or statement at end of input
   78 | }
      | ^
Language: C

#include <stdio.h>

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

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

int isStable(int a[],int b[],int N){
  int i;
  for(i=0;i<N;i++){
    if(a[i]!=b[i]){
      return false;
    }
  return true;
}

int main(void)
{
  int i,N,a[100],b[100];
  scanf("%d",&N);
  ??
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
    scanf("%d",&b[i]);
    b[i]=a[i]
  }
  bubble(a[],N);
  select(b[],N);
  
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("%d\n");
??
  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",b[i]);
  }
  printf("%d\n");
  
  if(isStable(a[],b[],N)){
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'isStable':
main.c:37:14: error: 'false' undeclared (first use in this function)
   37 |       return false;
      |              ^~~~~
main.c:2:1: note: 'false' 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:37:14: note: each undeclared identifier is reported only once for each function it appears in
   37 |       return false;
      |              ^~~~~
main.c:39:10: error: 'true' undeclared (first use in this function)
   39 |   return true;
      |          ^~~~
main.c:39:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:46:3: error: expected expression before '?' token
   46 |   ??
      |   ^
main.c:53:12: error: expected expression before ']' token
   53 |   select(b[],N);
      |            ^
main.c:62:1: error: expected expression before '?' token
   62 | ??
      | ^
main.c:71:17: error: expected expression before ']' token
   71 |   if(isStable(a[],b[],N)){
      |                 ^
main.c: In function 'isStable':
main.c:78:1: error: expected declaration or statement at end of input
   78 | }
      | ^
Language: C

#include <stdio.h>

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

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

int isStable(int a[],int b[],int N){
  int i;
  for(i=0;i<N;i++){
    if(a[i]!=b[i]){
      return false;
    }
  return true;
}

int main(void)
{
  int i,N,a[100],b[100];
  scanf("%d",&N);

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

for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",a[i]);
  }
  printf("%d\n");

  for(i=0;i<N;i++){
    if(i>0){
      printf(" ");
    }
    printf("%d",b[i]);
  }
  printf("%d\n");
  
  if(isStable(a[],b[],N)){
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'isStable':
main.c:37:14: error: 'false' undeclared (first use in this function)
   37 |       return false;
      |              ^~~~~
main.c:2:1: note: 'false' 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:37:14: note: each undeclared identifier is reported only once for each function it appears in
   37 |       return false;
      |              ^~~~~
main.c:39:10: error: 'true' undeclared (first use in this function)
   39 |   return true;
      |          ^~~~
main.c:39:10: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:50:14: error: expected ';' before '}' token
   50 |     b[i]=a[i]
      |              ^
      |              ;
   51 |   }
      |   ~           
main.c:52:12: error: expected expression before ']' token
   52 |   bubble(a[],N);
      |            ^
main.c:53:12: error: expected expression before ']' token
   53 |   select(b[],N);
      |            ^
main.c:71:17: error: expected expression before ']' token
   71 |   if(isStable(a[],b[],N)){
      |                 ^
main.c: In function 'isStable':
main.c:78:1: error: expected declaration or statement at end of input
   78 | }
      | ^