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

#include<bits/stdc++.h>

using namespace std;

namespace ADL {
  struct Data  { int x; };
  void print(Data data) { cout << data.x << endl; }
}


int I  = 42;
const int CI = I; // OK!

int* pI  = &I;
const int* pCI = pI; // OK!
const int* ppp = &CI;

int** ppI  = &pI;
//const int** ppCI = ppI; // ?????????????????¨??????! int** ?????? const int** ?????????????????§????????????!

/*
int* - pointer to int
int const * - pointer to const int
int * const - const pointer to int
int const * const - const pointer to const int
Now the first const can be on either side of the type so:

const int * == int const *
const int * const == int const * const
If you want to go really crazy you can do things like this:

int ** - pointer to pointer to int
int ** const - a const pointer to a pointer to an int
int * const * - a pointer to a const pointer to an int
int const ** - a pointer to a pointer to a const int
int * const * const - a const pointer to a const pointer to an int

 */

int main() {
  auto int x = 123;
  const int v = 215;
  ppp = &v;
  pCI = &v;
  cout << *ppp << endl;
  cout << *pCI << endl;
  
  cout << *pCI << endl;
  I = 51;
  cout << *pCI << endl;
  cout << **ppI << endl;
  return 0;

  ADL::Data data = (ADL::Data){5};
  print(data); // Argment dependent lookup (ADL)
  
  return 0;
}

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

#include<stdio.h>
#include<conio.h>

void partiton(int A[],int,int);

void main()
{
 int A[45],q,i;
 printf("Enter the number of elements in the Array: ");
 scanf("%d",&q);

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

 partition(A,0,q-1);
 printf("\nThe Sorted Array is:\n\n");

 for(i=0 ; i<q ; i++)
 {
  printf(" %4d",A[i]);
 }
 getch();
}

void partition(int A[],int p,int r)
{
 int xchg,j,temp,i;
 if(p<r)
 {
  xchg = p;
  i = p;
  j = r;

  while(i<j)
  {
   while((A[i]<=A[xchg])&&(i<r))
   {
    i++;
   }

   while(A[j]>A[xchg])
   {
    j--;
   }

   if(i<j)
   {
    temp=A[i];
    A[i]=A[j];
    A[j]=temp;
   }
  }

  temp=A[xchg];
  A[xchg]=A[j];
  A[j]=temp;
  partition(A,p,j-1);
  partition(A,j+1,r);
 }
}

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

#include<stdio.h>
 
void partiton(int A[],int,int);
 
void main()
{
 int A[45],q,i;
 printf("Enter the number of elements in the Array: ");
 scanf("%d",&q);
 
 for(i=0 ; i<q ; i++)
 {
  printf(" Array[%d] = ",i);
  scanf("%d",& A[i]);
 }
 
 partition(A,0,q-1);
 printf("\nThe Sorted Array is:\n\n");
 
 for(i=0 ; i<q ; i++)
 {
  printf(" %4d",A[i]);
 }
 getch();
}
 
void partition(int A[],int p,int r)
{
 int xchg,j,temp,i;
 if(p<r)
 {
  xchg = p;
  i = p;
  j = r;
 
  while(i<j)
  {
   while((A[i]<=A[xchg])&&(i<r))
   {
    i++;
   }
 
   while(A[j]>A[xchg])
   {
    j--;
   }
 
   if(i<j)
   {
    temp=A[i];
    A[i]=A[j];
    A[j]=temp;
   }
  }
 
  temp=A[xchg];
  A[xchg]=A[j];
  A[j]=temp;
  partition(A,p,j-1);
  partition(A,j+1,r);
 }
}

Compiler output:
main.c: In function 'main':
main.c:17:2: error: implicit declaration of function 'partition'; did you mean 'partiton'? [-Wimplicit-function-declaration]
   17 |  partition(A,0,q-1);
      |  ^~~~~~~~~
      |  partiton
main.c:24:2: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   24 |  getch();
      |  ^~~~~
      |  getc
main.c: At top level:
main.c:27:6: warning: conflicting types for 'partition'; have 'void(int *, int,  int)'
   27 | void partition(int A[],int p,int r)
      |      ^~~~~~~~~
main.c:17:2: note: previous implicit declaration of 'partition' with type 'void(int *, int,  int)'
   17 |  partition(A,0,q-1);
      |  ^~~~~~~~~
Language: C

#include<stdio.h>
#define MAX 100000

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

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

    return i+1;
}
void quickSort(Roll *A,int p,int r){
  int q;
  if(p < r){
    q = partition(A,p,r);
    quickSort(A,p,q-1);
    quickSort(A,q+1,r);
  }
}

void BubbleSort(Roll *Sort,int n){

  int i,flag=1;
  Roll tmp;

  while(flag){
    flag = 0;
    for(i = 0;i < n;i++){
      if(Sort[i].value < Sort[i-1].value){
	tmp = Sort[i];
	Sort[i]=Sort[i-1];
	Sort[i-1]=tmp;
	flag = 1;
      }
    }
  }
}
int  isStable(Roll *in,Roll *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].value==in[j].value&&in[i].value == out[b].value&&in[i].card==out[b].card&&in[j].value== out[a].value&&in[j].card==out[a].card)
	    return 0;
	}
      }
    }
  }
  return 1;
}
int main(){

  Roll A[MAX],B[MAX];
  int i,n;
  char str;

  scanf("%d",&n);

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

  quickSort(A,0,n-1);

  if(isStable(A,B,n)==1)
    printf("Stable\n");
  else printf("Not stable\n");
  
  for(i=0;i<n;i++) printf("%c %d\n",A[i].card,A[i].value);

  return 0;
}

Compiler output:
main.c: In function 'partition':
main.c:11:3: error: expected ',' or ';' before 'int'
   11 |   int i=p-1,j;
      |   ^~~
main.c:13:7: error: 'j' undeclared (first use in this function)
   13 |   for(j=p;j<r;j++){
      |       ^
main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:7: error: 'i' undeclared (first use in this function)
   16 |       i+=1;
      |       ^
Language: C

#include<stdio.h>
#define N 100000
#define INFTY 1000000000
 
struct Card{
  char suit;
  int value;
};
 
struct Card L[N], R[N];
 
void merge(struct Card [], int , int , int );
void mergeSort(struct Card [], int , int ); 
int partition(struct Card [], int , int );
void quickSort(struct Card [], int , int );
 
int main(){
   
  int n, i, v;
  struct Card A[N], B[N];
  char S[10];
  int stable = 1;
   
  scanf("%d", &n);
 
  for ( i = 0; i < n; i++ ) {
    scanf("%s %d", S, &v);
    A[i].suit = S[0];
    B[i].suit = S[0];
    A[i].value = v;
    B[i].value = v;
  }
 
  mergeSort(A, 0, n);
  quickSort(B, 0, n-1);
 
  for ( i = 0; i < n; i++ ){
    if ( A[i].suit != B[i].suit ) {
      stable = 0;
    }
  }
 
  if ( stable == 1 ) {
    printf("Stable\n");
  }
  else{
    printf("Not stable\n");
  }
  for ( i = 0; i < n; i++ ) {
    printf("%c %d\n", B[i].suit, B[i].value);
  }
  return 0;
}
 
void merge(struct Card A[], int l, int mid, int r){
   
  int i, j, k, n1, n2;
   
  n1 = mid - l;
  n2 = r - mid;
   
  for(i=0;i<n1;i++){
    L[i] = A[l + i];
  }
  for(i=0;i<n2;i++){
    R[i] = A[mid + i];
  }
 
  L[n1].value=INFTY;
  R[n2].value=INFTY;
  i=0;
  j=0;
   
  for ( k = l; k < r; k++ ){
    if ( L[i].value <= R[j].value ){
      A[k] = L[i];
      i++;
    }
    else {
      A[k] = R[j];
      j++;
    }
  }
}
 
void mergeSort(struct Card A[], int l, int r){
   
  int mid;
   
  if (l+1 < r){
    mid = (l + r)/2;
    mergeSort(A, l, mid);
    mergeSort(A, mid, r);
    merge(A, left, mid, r);
  }
}
 
int partition(struct Card A[], int p, int r){
  int i, j;
  struct Card t, x;
  x = A[r];
  i = p - 1;
  for ( j = p; j <= r-1; j++ ){
    if ( A[j].value <= x.value ){
      i++;
      t = A[i];
      A[i] = A[j];
      A[j] = t;
    }
  }
  t = A[i+1];
  A[i+1] = A[r];
  A[r] = t;   
  return i+1;
}

void quickSort(struct Card A[], int p, int r){
  int q; 
  if ( p < r ){
    q = partition(A, p, r);
    quickSort(A, p, q - 1);
    quickSort(A, q + 1, r);
  }
}

Compiler output:
main.c: In function 'mergeSort':
main.c:94:14: error: 'left' undeclared (first use in this function)
   94 |     merge(A, left, mid, r);
      |              ^~~~
main.c:94:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "problems.h"
#include "util.h"

static size_t _partition(card_t data[], size_t size)
{
  int64_t pivot = data[size - 1].num;

  size_t index = 0;
  uint32_t i;
  for (i = 0; i < size - 1; i++) {
    if (data[i].num <= pivot) {
      UTIL_SWAP(data[i], data[index]);
      index++;
    }
  }
  UTIL_SWAP(data[index], data[size - 1]);
  return index;
}

static void merge(card_t cards1[], card_t cards2[], size_t cards1_len, size_t cards2_len)
{
  uint32_t i;
  card_t *data1 = malloc(sizeof(card_t) * (cards1_len + 1));
  card_t *data2 = malloc(sizeof(card_t) * (cards2_len + 1));

  if ((data1 == NULL) || (data2 == NULL)) goto err;

  for (i = 0; i < cards1_len; i++) {
    data1[i] = cards1[i];
  }
  data1[cards1_len].num = INT64_MAX;

  for (i = 0; i < cards2_len; i++) {
    data2[i] = cards2[i];
  }
  data2[cards2_len].num = INT64_MAX;

  size_t len = cards1_len + cards2_len;
  size_t index1 = 0, index2 = 0;

  for (i = 0; i < len; i++) {
    if (data1[index1].num <= data2[index2].num) {
      cards1[i] = data1[index1];
      index1++;
    } else {
      cards1[i] = data2[index2];
      index2++;
    }
  }

  free(data1);
  free(data2);
  return;

err:
  perror("malloc error");
  exit(1);
}

static void quick_sort_merge_sort(card_t data[], size_t size)
{
  if (size <= 1) return;

  size_t index = size / 2;
  quick_sort_merge_sort(data, index);
  quick_sort_merge_sort(&data[index], size - index);
  merge(data, &data[index], index, size - index);
}

void quick_sort(card_t data[], size_t size)
{
  if (data == NULL) return;

  if (size <= 1) return;

  size_t index = _partition(data, size);
  quick_sort(data, index);
  quick_sort(&data[index], size - index);

  return;
}

bool quick_sort_is_stable(card_t cards[], size_t len)
{
  card_t *cards2 = malloc(sizeof(card_t) * len);
  memcpy(cards2, cards, sizeof(card_t) * len);

  quick_sort(cards, len);
  quick_sort_merge_sort(cards2, len);

  uint32_t i;
  for (i = 0; i < len; i++) {
    if ((cards[i].num != cards2[i].num) || (cards[i].design != cards2[i].design)) {
      return false;
    }
  }

  return true;
}

#if !defined(TEST)
#include <stdio.h>

static card_t cards[100000];

int32_t main(void)
{
  int32_t num;
  scanf("%d", &num);

  uint32_t i;
  for (i = 0; i < num; i++) {
    uint8_t design[1];
    int64_t number;
    scanf("%s %ld", design, &number);
    cards[i].num = number;
    cards[i].design = design[0];
  }

  bool ret = quick_sort_is_stable(cards, num);

  if (ret) {
    printf("Stable\n");
  } else {
    printf("Not stable\n");
  }

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

  return 0;
}
#endif

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

include<stdio.h>
#define MAX 100000
#define SENTINEL 2000000000

struct Card{
  char suit;
  int value;
};

struct Card L[MAX/2+2], R[MAX/2+2];

void merge(struct Card A[], int n, int left, int mid, int right){

  int i, j, k;
  int n1 = mid - left;
  int n2 = right - mid;

  for(i=0; i<n1; i++){
    L[i] = A[left+1];
  }
  for(i=0; i<n2; i++){
    R[i] = A[mid+i];
  }

  L[n1].value = R[n2].value = SENTINEL;
  i = j = 0;

  for(k=left; k<right; k++){
    if(L[i].value <= R[j].value){
      A[k] = L[i++];
    }
    else{
      A[k] = R[j++];
    }
  }

}

  mergeSort(A, n, 0, n);
  quickSort(B, n, 0, n-1);

  for(i=0; i<n; i++){
    if(A[i].suit != B[i].suit){
      stable = 0;
    }
  }

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

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

  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c:10:13: error: array type has incomplete element type 'struct Card'
   10 | struct Card L[MAX/2+2], R[MAX/2+2];
      |             ^
main.c:10:25: error: array type has incomplete element type 'struct Card'
   10 | struct Card L[MAX/2+2], R[MAX/2+2];
      |                         ^
main.c:12:24: error: array type has incomplete element type 'struct Card'
   12 | void merge(struct Card A[], int n, int left, int mid, int right){
      |                        ^
main.c:39:18: error: expected ')' before numeric constant
   39 |   mergeSort(A, n, 0, n);
      |                  ^~
      |                  )
main.c:40:18: error: expected ')' before numeric constant
   40 |   quickSort(B, n, 0, n-1);
      |                  ^~
      |                  )
main.c:42:3: error: expected identifier or '(' before 'for'
   42 |   for(i=0; i<n; i++){
      |   ^~~
main.c:42:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   42 |   for(i=0; i<n; i++){
      |             ^
main.c:42:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   42 |   for(i=0; i<n; i++){
      |                  ^~
main.c:48:3: error: expected identifier or '(' before 'if'
   48 |   if(stable==1){
      |   ^~
main.c:51:3: error: expected identifier or '(' before 'else'
   51 |   else{
      |   ^~~~
main.c:55:3: error: expected identifier or '(' before 'for'
   55 |   for(i=0; i<n; i++){
      |   ^~~
main.c:55:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   55 |   for(i=0; i<n; i++){
      |             ^
main.c:55:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   55 |   for(i=0; i<n; i++){
      |                  ^~
main.c:59:3: error: expected identifier or '(' before 'return'
   59 |   return 0;
      |   ^~~~~~
main.c:60:1: error: expected identifier or '(' before '}' token
   60 | }
      | ^
Language: C

#include<stdio.h>
#define MAX 100000
#define SENTINEL 2000000000

struct Card{
  char suit;
  int value;
};

struct Card L[MAX/2+2], R[MAX/2+2];

void merge(struct Card A[], int n, int left, int mid, int right){

  int i, j, k;
  int n1 = mid - left;
  int n2 = right - mid;

  for(i=0; i<n1; i++){
    L[i] = A[left+1];
  }
  for(i=0; i<n2; i++){
    R[i] = A[mid+i];
  }

  L[n1].value = R[n2].value = SENTINEL;
  i = j = 0;

  for(k=left; k<right; k++){
    if(L[i].value <= R[j].value){
      A[k] = L[i++];
    }
    else{
      A[k] = R[j++];
    }
  }

}

  mergeSort(A, n, 0, n);
  quickSort(B, n, 0, n-1);

  for(i=0; i<n; i++){
    if(A[i].suit != B[i].suit){
      stable = 0;
    }
  }

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

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

  return 0;
}

Compiler output:
main.c:39:18: error: expected ')' before numeric constant
   39 |   mergeSort(A, n, 0, n);
      |                  ^~
      |                  )
main.c:40:18: error: expected ')' before numeric constant
   40 |   quickSort(B, n, 0, n-1);
      |                  ^~
      |                  )
main.c:42:3: error: expected identifier or '(' before 'for'
   42 |   for(i=0; i<n; i++){
      |   ^~~
main.c:42:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   42 |   for(i=0; i<n; i++){
      |             ^
main.c:42:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   42 |   for(i=0; i<n; i++){
      |                  ^~
main.c:48:3: error: expected identifier or '(' before 'if'
   48 |   if(stable==1){
      |   ^~
main.c:51:3: error: expected identifier or '(' before 'else'
   51 |   else{
      |   ^~~~
main.c:55:3: error: expected identifier or '(' before 'for'
   55 |   for(i=0; i<n; i++){
      |   ^~~
main.c:55:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   55 |   for(i=0; i<n; i++){
      |             ^
main.c:55:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   55 |   for(i=0; i<n; i++){
      |                  ^~
main.c:59:3: error: expected identifier or '(' before 'return'
   59 |   return 0;
      |   ^~~~~~
main.c:60:1: error: expected identifier or '(' before '}' token
   60 | }
      | ^
Language: C

#include <stdio.h>
#define N 100000
#define S 200000000

typedef struct {
  char m;
  int v;
}Card;

Card L[N/2+2], R[N/2+2];

int partition(Card A[], int p, int r){
  int i, j;
  Card x, temp1, temp2;;
  
  x = A[r];
  i = p-1;
  for(j=p; j<r; j++){
    if(A[j]<=x){

      i = i+1;
      temp1 = A[i];
      A[i] = A[j];
      A[j] = temp1;
    }
  }
  temp2 = A[i+1];
  A[i+1] = A[r];
  A[r] = temp2;
  return i+1;
}

void quicksort(Card A[], int p, int r){
  int q=0;

  if(p<r){
    q = partition(A, p, r);
    quicksort(A, p, q-1);
    quicksort(A, q+1, r);
  }
}

void merge(Card A[], int l, int r, int m){
  int i, j, k;
  int n1 = m-l, n2 = r-m;

  for(i=0; i<n1; i++) L[i] = A[l+i];
  for(i=0; i<n2; i++) R[i] = A[m+i];
  L[n1].v = R[n2].v = S;
  i = j = 0;
  for(k=l; k<r; k++){
    if(L[i].v <= R[j].v){
      A[k] = L[i++];
    } else {
      A[k] = R[j++];
    }
  }
}
    
void mergeSort(Card A[], int l, int r){
    int m;
    if(l+1<r){
      m = (l+r)/2;
      mergesort(A, l, m); 
      mergesort(A, m, r);
      merge(A, l, m, r);
    }
}

int main(){

  int i, n, stable=1;
  char S[10];
  Card A[N], B[N];
  
  scanf("%d", &n);
  for(i=0; i<n; i++){
    scanf("%c %d", &A[i].m, &A[i].v);  
  }

  for(i=0; i<n; i++){
    B[i].m = A[i].m;
    B[i].v = B[i].v;
  }

  mergesort(A, 0, n);
  quicksort(B, 0, n-1);

  for(i=0; i<n; i++){
    if(A[i].m != B[i].m) stable = 0;
  }

  if(stable == 1) printf("Stable\n");
  else printf("Not stable\n");
  for(i=0; i<n; i++){
    printf("%c %d\n", B[i].m, B[i].v);
  }
    
  return 0;
}

Compiler output:
main.c: In function 'partition':
main.c:19:12: error: invalid operands to binary <= (have 'Card' and 'Card')
   19 |     if(A[j]<=x){
      |        ~~~~^~
      |         |
      |         Card
main.c: In function 'mergeSort':
main.c:64:7: error: implicit declaration of function 'mergesort'; did you mean 'mergeSort'? [-Wimplicit-function-declaration]
   64 |       mergesort(A, l, m);
      |       ^~~~~~~~~
      |       mergeSort
main.c: In function 'main':
main.c:3:11: error: expected identifier or '(' before numeric constant
    3 | #define S 200000000
      |           ^~~~~~~~~
main.c:73:8: note: in expansion of macro 'S'
   73 |   char S[10];
      |        ^
Language: C

#include <stdio.h>
#define N 100000
#define S 200000000

typedef struct {
  char m;
  int v;
}Card;

Card L[N/2+2], R[N/2+2];

int partition(Card A[], int p, int r){
  int i, j;
  Card x, temp1, temp2;;
  
  x = A[r];
  i = p-1;
  for(j=p; j<r; j++){
    if(A[j].v<=x.v){

      i = i+1;
      temp1 = A[i];
      A[i] = A[j];
      A[j] = temp1;
    }
  }
  temp2 = A[i+1];
  A[i+1] = A[r];
  A[r] = temp2;
  return i+1;
}

void quicksort(Card A[], int p, int r){
  int q=0;

  if(p<r){
    q = partition(A, p, r);
    quicksort(A, p, q-1);
    quicksort(A, q+1, r);
  }
}

void merge(Card A[], int l, int r, int m){
  int i, j, k;
  int n1 = m-l, n2 = r-m;

  for(i=0; i<n1; i++) L[i] = A[l+i];
  for(i=0; i<n2; i++) R[i] = A[m+i];
  L[n1].v = R[n2].v = S;
  i = j = 0;
  for(k=l; k<r; k++){
    if(L[i].v <= R[j].v){
      A[k] = L[i++];
    } else {
      A[k] = R[j++];
    }
  }
}
    
void mergeSort(Card A[], int l, int r){
    int m;
    if(l+1<r){
      m = (l+r)/2;
      mergesort(A, l, m); 
      mergesort(A, m, r);
      merge(A, l, m, r);
    }
}

int main(){

  int i, n, stable=1;
  //  char S[10];
  Card A[N], B[N];
  
  scanf("%d", &n);
  for(i=0; i<n; i++){
    scanf("%c %d", &A[i].m, &A[i].v);  
  }

  for(i=0; i<n; i++){
    B[i].m = A[i].m;
    B[i].v = B[i].v;
  }

  mergesort(A, 0, n);
  quicksort(B, 0, n-1);

  for(i=0; i<n; i++){
    if(A[i].m != B[i].m) stable = 0;
  }

  if(stable == 1) printf("Stable\n");
  else printf("Not stable\n");
  for(i=0; i<n; i++){
    printf("%c %d\n", B[i].m, B[i].v);
  }
    
  return 0;
}

Compiler output:
main.c: In function 'mergeSort':
main.c:64:7: error: implicit declaration of function 'mergesort'; did you mean 'mergeSort'? [-Wimplicit-function-declaration]
   64 |       mergesort(A, l, m);
      |       ^~~~~~~~~
      |       mergeSort
Language: C

#include <stdio.h>
struct s{
  int num;
  char moji;
  int key;
};
struct s A[100001];

int Partition(int p,int r){
  int i,j;
  struct s x,tmp;
  x.num=A[r].num;
  i=p-1;
  for(j=p;j<r;j++){
    if(A[j].num<=x.num){
      i=i+1;
      tmp=A[i];
      A[i]=A[j];
      A[j]=tmp;
    }
  }
  tmp=A[i+1];
  A[i+1]=A[r];
  A[r]=tmp;
  return i+1;
}
 
void Quicksort(int p,int r){
  int q;
  if(p<r){
    q=Partition(p,r);
    Quicksort(p,q-1);
    Quicksort(q+1,r);
  }
}

main(){
  char c1,c2,c3;
  int n,ia,b=0;
  scanf("%d%c",&n,&c1);
  for(i=0;i<n;i++){
    scanf("%c%c%d%c",&A[i].moji,&c2,&A[i].num,&c3);
    A[i].key=i;
  }
  a = Partition(0,n-1);
  Quicksort(0,n-1);
  for(i=0;i<n;i++){
    if(A[i].key>A[i+1].key && A[i].num==A[i+1].num){
      b=1;
      break;
    }
  }
  if(b==0){
    printf("Stable\n");
  }
  if(b==1){
    printf("Not stable\n");
  }
  for(i=0;i<n;i++){
    printf("%c %d\n",A[i].moji,A[i].num);
  }
  return 0;
}
 

Compiler output:
main.c:37:1: error: return type defaults to 'int' [-Wimplicit-int]
   37 | main(){
      | ^~~~
main.c: In function 'main':
main.c:41:7: error: 'i' undeclared (first use in this function)
   41 |   for(i=0;i<n;i++){
      |       ^
main.c:41:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:3: error: 'a' undeclared (first use in this function)
   45 |   a = Partition(0,n-1);
      |   ^
Language: C

#include <stdio.h>
#define MAX 100000
struct Card{
  char a;
  int b;
};
struct Card L[MAX/2+2], R[MAX/2+2];
int n;

void merge(struct Card A[], int left, int mid, int right){
  int n1, n2, i, j, k;

  n1 = mid - left;
  n2 = right - mid;

  for(i = 0; i <= n1-1; i++) L[i] = A[left + i];
  for(i = 0; i <= n2-1; i++) R[i] = A[mid + i];
  L[n1] = 1000000001;
  R[n2] = 1000000001;
  i = j = 0;
  for(k = left; k <= right-1; k++){
    if(L[i].b <= R[j].b){
      A[k] = L[i++];
    }
    else{
      A[k] = R[j++];
    }
  }
}

void mergeSort(struct Card A[], int left, int right){
  int mid;
  if(left+1 < right){
    mid = (left + right)/2;
    mergeSort(A,left, mid);
    mergeSort(A,mid, right);
    merge(A,left, mid, right);
  }
}
int partition(struct Card A[], int p, int r){
  int i, j;
  struct Card x, t;
  x = A[r];
  i = p - 1;
  for(j = p; j < r; j++){
    if(A[j].b <= x.b){
      i++;
      t = A[i];
      A[i] = A[j];
      A[j] = t;
    }
  }
  t = A[i+1];
  A[i+1] = A[r];
  A[r] = t;
  return i+1;
}

void Quicksort(struct Card A[], int p, int r){
  int q;
  if(p < r){
    q = partition(A, p, r);
    Quicksort(A, p, q-1);
    Quicksort(A, q+1, r);
  }
}
int main()
{
  int i, v, f = 0;
  struct Card x[MAX], y[MAX];
  char s[10];

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%s %d", s, &v);
    x[i].a = y[i].a = s[0];
    x[i].b = y[i].b = v;
  }
  Quicksort(x, 0, n-1);
  mergeSort(y, 0, n);

  for(i = 0; i < n; i++){
    if(x[i].a != y[i].a) f = 1;
  }
  if(f == 0) printf("Stable\n");
  else printf("Not stable\n");

  for(i = 0; i < n; i++) printf("%c %d\n", x[i].a, x[i].b);
  return 0;
}

Compiler output:
main.c: In function 'merge':
main.c:18:11: error: incompatible types when assigning to type 'struct Card' from type 'int'
   18 |   L[n1] = 1000000001;
      |           ^~~~~~~~~~
main.c:19:11: error: incompatible types when assigning to type 'struct Card' from type 'int'
   19 |   R[n2] = 1000000001;
      |           ^~~~~~~~~~
Language: C

#include <stdio.h>
#define MAX 100000
#define SEN 20000000000

struct Card{
	char suit;
	int value;
};

struct Card L[MAX/2+2],R[MAX/2+2];

void merge(struct Card A[],int n,int left,int mid,int right){
	int i;
	int n1 = mid;
	int n2 = right - mid;
	for(i=0;i<n1;i++){
		L[i] = A[left+i];
	}
	
	for(i=0;i<n2;i++){
		R[i] = A[mid+i];
	}
	
	L[n1].value = R[n2].value=SEN;

	
	int i=0,j=0,k;
	for(k=left;k<right;k++){
	if(L[i].value<=R[j].value){
		A[k] = L[i++];
	}else{
		A[k] = R[j++];
	}
}
}

void mergeSort(struct Card A[],int n, int left, int right){
	if(left+1<right){
		int mid = (left+right)/2;
			mergeSort(A,n,left,mid);
			mergeSort(A,n,mid,right);
			merge(A,n,left,mid,right);		
	}
}


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


void quickSort(struct Card A[], int n,int p,int r){
	int q;
	if(p<r){
		q = partition(A,p,r);
		quickSort(A,n,p,q-1);
		quickSort(A,n,q+1,r);	
	}
} 



int main(){
	int n,i,v;
	struct Card A[MAX],B[MAX];
	char S[10];
	int stable = 1;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s %d",S,&v);
		A[i].suit=B[i].suit=S[0];
		A[i].value=B[i].value=v;
	}
	
	mergeSort(A,n,0,n);
	quickSort(B,n,0,n-1);
	
	for(i=0;i<n;i++){
		if(A[i].suit!=B[i].suit){
		stable=0;
		break;}
	}
	
	if(stable==1) printf("Stable\n");
	else printf("Not stable\n");
	for(i=0;i<n;i++){
		printf("%c %d\n",B[i].suit,B[i].value);
	}
	return 0;
}

Compiler output:
main.c: In function 'merge':
main.c:3:13: warning: overflow in conversion from 'long int' to 'int' changes value from '20000000000' to '-1474836480' [-Woverflow]
    3 | #define SEN 20000000000
      |             ^~~~~~~~~~~
main.c:24:35: note: in expansion of macro 'SEN'
   24 |         L[n1].value = R[n2].value=SEN;
      |                                   ^~~
main.c:27:13: error: redeclaration of 'i' with no linkage
   27 |         int i=0,j=0,k;
      |             ^
main.c:13:13: note: previous declaration of 'i' with type 'int'
   13 |         int i;
      |             ^
Language: C

#include <stdio.h>
#define N 100000
#define INF 1000000

struct Card_t{
  char art;
  int value;
}

struct Card_t L[N/2+2],R[N/2+2];

int n;

void merge(struct Card_t A[],int n,int l,int m,int r){
  int i,j,k;
  int n1 = m - l;
  int n2 = r - m;
  for(i=0;i<n1;i++)L[i]=A[l+i];
  for(i=0;i<n2;i++)R[i]=A[m+i];
  L[n1].value = R[n2].value = INF;
  i = j = 0;
  for(k = l;k < r;k++){
    if(L[i].value <= R[j].value){
      A[k]=L[i++];
    }else{
      A[k]=R[j++];
    }
  }
}

void mergeSort(struct Card_t A[],int l,int r){
????int m;

????if(l + 1 < r){
????????m = (l + r)/2;
????????mergeSort(A,n,l,m);
????????mergeSort(A,n,m,r);
????????merge(A,n,l,m,r);
????}
}

int partition(struct Card_t A[],int p,int r){
  int i,j;
  struct Card_t temp,s;
  s = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j].value <= s.value){
      i++;
      temp=A[i];
      A[i]=A[j];
      A[j]=temp;
    }
  }
  temp = A[i+1];
  A[i+1]=A[r];
  A[r]=temp;
  return i+1;
}

void quickSort(struct Card_t A[], int p, int r){
  if (p < r){
  q = partition(A, p, r);
  quickSort(A, p, q-1);
  quickSort(A, q+1, r);
  }
} 

int main(){
int i,num,stable=1;

struct Card_t A[MAX],B[MAX];
char art;

scanf("%d",&n);

for(i=0;i<n;i++){
  scanf("%c %d",&art,&num);
  A[i].art=B[i].art=art;
  A[i].value=B[i].value=v;
}

mergeSort(A,0,n);
quickSort(B,0,n-1);

for(i=0;i<n;i++){
  if(A[i].art!=B[i].art) stable=0;
}

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

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

return 0;
}

Compiler output:
main.c:10:1: error: expected ';', identifier or '(' before 'struct'
   10 | struct Card_t L[N/2+2],R[N/2+2];
      | ^~~~~~
main.c: In function 'mergeSort':
main.c:32:1: error: expected expression before '?' token
   32 | ????int m;
      | ^
main.c:34:1: error: expected expression before '?' token
   34 | ????if(l + 1 < r){
      | ^
main.c: In function 'quickSort':
main.c:63:3: error: 'q' undeclared (first use in this function)
   63 |   q = partition(A, p, r);
      |   ^
main.c:63:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:72:17: error: 'MAX' undeclared (first use in this function)
   72 | struct Card_t A[MAX],B[MAX];
      |                 ^~~
main.c:80:25: error: 'v' undeclared (first use in this function)
   80 |   A[i].value=B[i].value=v;
      |                         ^
Language: C

#include <stdio.h>
#define N 100000
#define INF 1000000

struct Card_t{
  char art;
  int value;
}

struct Card_t L[N/2+2],R[N/2+2];

int n;

void merge(struct Card_t A[],int l,int m,int r){
  int i,j,k;
  int n1 = m - l;
  int n2 = r - m;
  for(i=0;i<n1;i++)L[i]=A[l+i];
  for(i=0;i<n2;i++)R[i]=A[m+i];
  L[n1].value = R[n2].value = INF;
  i = j = 0;
  for(k = l;k < r;k++){
    if(L[i].value <= R[j].value){
      A[k]=L[i++];
    }else{
      A[k]=R[j++];
    }
  }
}

void mergeSort(struct Card_t A[],int l,int r){
????int m;

????if(l + 1 < r){
????????m = (l + r)/2;
????????mergeSort(A,l,m);
????????mergeSort(A,m,r);
????????merge(A,l,m,r);
????}
}

int partition(struct Card_t A[],int p,int r){
  int i,j;
  struct Card_t temp,s;
  s = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j].value <= s.value){
      i++;
      temp=A[i];
      A[i]=A[j];
      A[j]=temp;
    }
  }
  temp = A[i+1];
  A[i+1]=A[r];
  A[r]=temp;
  return i+1;
}

void quickSort(struct Card_t A[], int p, int r){
  int q;
  if (p < r){
  q = partition(A, p, r);
  quickSort(A, p, q-1);
  quickSort(A, q+1, r);
  }
} 

int main(){
int i,num,stable=1;

struct Card_t A[N],B[N];
char art;

scanf("%d",&n);

for(i=0;i<n;i++){
  scanf("%c %d",&art,&num);
  A[i].art=B[i].art=art;
  A[i].value=B[i].value=num;
}

mergeSort(A,0,n);
quickSort(B,0,n-1);

for(i=0;i<n;i++){
  if(A[i].art!=B[i].art) stable=0;
}

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

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

return 0;
}

Compiler output:
main.c:10:1: error: expected ';', identifier or '(' before 'struct'
   10 | struct Card_t L[N/2+2],R[N/2+2];
      | ^~~~~~
main.c: In function 'mergeSort':
main.c:32:1: error: expected expression before '?' token
   32 | ????int m;
      | ^
main.c:34:1: error: expected expression before '?' token
   34 | ????if(l + 1 < r){
      | ^
Language: C

#include <stdio.h>
#define N 100000
#define INF 1000000

struct Card_t{
  char art;
  int value;
}

struct Card_t L[N/2+2],R[N/2+2];

int n;

void mergeSort(struct Card_t A[],int l,int r){
????int m;

????if(l + 1 < r){
????????m = (l + r)/2;
????????mergeSort(A,l,m);
????????mergeSort(A,m,r);
????????merge(A,l,m,r);
????}
}

void merge(struct Card_t A[],int l,int m,int r){
  int i,j,k;
  int n1 = m - l;
  int n2 = r - m;
  for(i=0;i<n1;i++)L[i]=A[l+i];
  for(i=0;i<n2;i++)R[i]=A[m+i];
  L[n1].value = R[n2].value = INF;
  i = j = 0;
  for(k = l;k < r;k++){
    if(L[i].value <= R[j].value){
      A[k]=L[i++];
    }else{
      A[k]=R[j++];
    }
  }
}

int partition(struct Card_t A[],int p,int r){
  int i,j;
  struct Card_t temp,s;
  s = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j].value <= s.value){
      i++;
      temp=A[i];
      A[i]=A[j];
      A[j]=temp;
    }
  }
  temp = A[i+1];
  A[i+1]=A[r];
  A[r]=temp;
  return i+1;
}

void quickSort(struct Card_t A[], int p, int r){
  int q;
  if (p < r){
  q = partition(A, p, r);
  quickSort(A, p, q-1);
  quickSort(A, q+1, r);
  }
} 

int main(){
int i,num,stable=1;

struct Card_t A[N],B[N];
char art;

scanf("%d",&n);

for(i=0;i<n;i++){
  scanf("%c %d",&art,&num);
  A[i].art=B[i].art=art;
  A[i].value=B[i].value=num;
}

mergeSort(A,0,n);
quickSort(B,0,n-1);

for(i=0;i<n;i++){
  if(A[i].art!=B[i].art) stable=0;
}

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

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

return 0;
}

Compiler output:
main.c:10:1: error: expected ';', identifier or '(' before 'struct'
   10 | struct Card_t L[N/2+2],R[N/2+2];
      | ^~~~~~
main.c: In function 'mergeSort':
main.c:15:1: error: expected expression before '?' token
   15 | ????int m;
      | ^
main.c:17:1: error: expected expression before '?' token
   17 | ????if(l + 1 < r){
      | ^
Language: C

#include <stdio.h>
#define N 100000
#define INF 1000000

struct Card_t{
  char art;
  int value;
};

struct Card_t L[N/2+2],R[N/2+2];

int n;

void merge(struct Card_t A[],int l,int m,int r){
  int i,j,k;
  int n1 = m - l;
  int n2 = r - m;
  for(i=0;i<n1;i++)L[i]=A[l+i];
  for(i=0;i<n2;i++)R[i]=A[m+i];
  L[n1].value = R[n2].value = INF;
  i = j = 0;
  for(k = l;k < r;k++){
    if(L[i].value <= R[j].value){
      A[k]=L[i++];
    }else{
      A[k]=R[j++];
    }
  }
}

void mergeSort(struct Card_t A[],int l,int r){
????int m;

????if(l + 1 < r){
????????m = (l + r)/2;
????????mergeSort(A,l,m);
????????mergeSort(A,m,r);
????????merge(A,l,m,r);
????}
}

int partition(struct Card_t A[],int p,int r){
  int i,j;
  struct Card_t temp,s;
  s = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j].value <= s.value){
      i++;
      temp=A[i];
      A[i]=A[j];
      A[j]=temp;
    }
  }
  temp = A[i+1];
  A[i+1]=A[r];
  A[r]=temp;
  return i+1;
}

void quickSort(struct Card_t A[], int p, int r){
  int q;
  if (p < r){
  q = partition(A, p, r);
  quickSort(A, p, q-1);
  quickSort(A, q+1, r);
  }
} 

int main(){
int i,num,stable=1;

struct Card_t A[N],B[N];
char art;

scanf("%d",&n);

for(i=0;i<n;i++){
  scanf("%c %d",&art,&num);
  A[i].art=B[i].art=art;
  A[i].value=B[i].value=num;
}

mergeSort(A,0,n);
quickSort(B,0,n-1);

for(i=0;i<n;i++){
  if(A[i].art!=B[i].art) stable=0;
}

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

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

return 0;
}

Compiler output:
main.c: In function 'mergeSort':
main.c:32:1: error: expected expression before '?' token
   32 | ????int m;
      | ^
main.c:34:1: error: expected expression before '?' token
   34 | ????if(l + 1 < r){
      | ^
Language: C

#include<stdio.h>
  
typedef struct _card {
  int number;
  char suit;
} CARD;
  
CARD A[100000], I[100000];
char inputs[1000000];
char *ptr = inputs;
  
void exchange(CARD *a, CARD *b);
int Partition(CARD A[], int p, int r);
void Quicksort(CARD A[], int p, int r);

int main(){
  int n;
  int stable = 1;
  int i, j, c, d;
      
  fread(inputs, sizeof(char), 1000000, stdin);
      
  n = nextInt();
      
  for (i = 0; i < n; ++i) {
    A[i].suit = nextSuit();
    A[i].number = nextInt();
    I[i] = A[i];
  }
      
  Quicksort(A, 0, n - 1);
      
  for (i = 0; i < n; ++i) {
    if (i == 0) {
      c = 0;
    } else if (A[i].number != A[i - 1].number) {
      c = 0;
    } else {
      ++c;
    }
    d = 0;
    for (j = 0; j < n; ++j) {
      if (I[j].number == A[i].number) {
	if (c == d) {
	  if (I[j].suit != A[i].suit) {
	    stable = 0;
	  }
	  break;
	}
	++d;
      }
    }
    if (stable == 0) {
      break;
    }
  }
      
  if (stable == 1) {
    puts("Stable");
  } else {
    puts("Not stable");
  }
      
  for (i = 0; i < n; ++i) {
    printf("%c %d\n", A[i].suit, A[i].number);
  }
      
  return 0;
}

int nextInt(void) {
  int v = 0;
  while (*ptr < '0' || *ptr > '9') ++ptr;
  while (*ptr >= '0' && *ptr <= '9') {
    v = v * 10 + (int)(*ptr - '0');
    ++ptr;
  }
  return v;
}
  
char nextSuit(void) {
  while (*ptr < 'A' || *ptr > 'Z') ++ptr;
  return *ptr;
}
  
void exchange(CARD *a, CARD *b) {
  CARD t = *a;
  *a = *b;
  *b = t;
}
  
int Partition(CARD A[], int p, int r) {
  CARD x = A[r];
  int i = p - 1;
  int j;
  for (j = p; j < r; ++j) {
    if (A[j].number <= x.number) {
      ++i;
      exchange(&A[i], &A[j]);
    }
  }
  exchange(&A[i + 1], &A[r]);
  return i + 1;
}
  
void Quicksort(CARD A[], int p, int r) {
  int q;
  if (p < r) {
    q = Partition(A, p, r);
    Quicksort(A, p, q - 1);
    Quicksort(A, q + 1, r);
  }
}

Compiler output:
main.c: In function 'main':
main.c:23:7: error: implicit declaration of function 'nextInt' [-Wimplicit-function-declaration]
   23 |   n = nextInt();
      |       ^~~~~~~
main.c:26:17: error: implicit declaration of function 'nextSuit' [-Wimplicit-function-declaration]
   26 |     A[i].suit = nextSuit();
      |                 ^~~~~~~~
main.c: At top level:
main.c:81:6: error: conflicting types for 'nextSuit'; have 'char(void)'
   81 | char nextSuit(void) {
      |      ^~~~~~~~
main.c:26:17: note: previous implicit declaration of 'nextSuit' with type 'int()'
   26 |     A[i].suit = nextSuit();
      |                 ^~~~~~~~
Language: C

#include<stdio.h>
  
typedef struct _card {
  int number;
  char suit;
} CARD;
  
CARD A[100000], I[100000];
char inputs[1000000];
char *ptr = inputs;
  
void exchange(CARD *a, CARD *b);
int Partition(CARD A[], int p, int r);
void Quicksort(CARD A[], int p, int r);

int main(void){
  int n;
  int stable = 1;
  int i, j, c, d;
      
  fread(inputs, sizeof(char), 1000000, stdin);
      
  n = nextInt();
      
  for (i = 0; i < n; ++i) {
    A[i].suit = nextSuit();
    A[i].number = nextInt();
    I[i] = A[i];
  }
      
  Quicksort(A, 0, n - 1);
      
  for (i = 0; i < n; ++i) {
    if (i == 0) {
      c = 0;
    } else if (A[i].number != A[i - 1].number) {
      c = 0;
    } else {
      ++c;
    }
    d = 0;
    for (j = 0; j < n; ++j) {
      if (I[j].number == A[i].number) {
	if (c == d) {
	  if (I[j].suit != A[i].suit) {
	    stable = 0;
	  }
	  break;
	}
	++d;
      }
    }
    if (stable == 0) {
      break;
    }
  }
      
  if (stable == 1) {
    puts("Stable");
  } else {
    puts("Not stable");
  }
      
  for (i = 0; i < n; ++i) {
    printf("%c %d\n", A[i].suit, A[i].number);
  }
      
  return 0;
}

int nextInt(void) {
  int v = 0;
  while (*ptr < '0' || *ptr > '9') ++ptr;
  while (*ptr >= '0' && *ptr <= '9') {
    v = v * 10 + (int)(*ptr - '0');
    ++ptr;
  }
  return v;
}
  
char nextSuit(void) {
  while (*ptr < 'A' || *ptr > 'Z') ++ptr;
  return *ptr;
}
  
void exchange(CARD *a, CARD *b) {
  CARD t = *a;
  *a = *b;
  *b = t;
}
  
int Partition(CARD A[], int p, int r) {
  CARD x = A[r];
  int i = p - 1;
  int j;
  for (j = p; j < r; ++j) {
    if (A[j].number <= x.number) {
      ++i;
      exchange(&A[i], &A[j]);
    }
  }
  exchange(&A[i + 1], &A[r]);
  return i + 1;
}
  
void Quicksort(CARD A[], int p, int r) {
  int q;
  if (p < r) {
    q = Partition(A, p, r);
    Quicksort(A, p, q - 1);
    Quicksort(A, q + 1, r);
  }
}

Compiler output:
main.c: In function 'main':
main.c:23:7: error: implicit declaration of function 'nextInt' [-Wimplicit-function-declaration]
   23 |   n = nextInt();
      |       ^~~~~~~
main.c:26:17: error: implicit declaration of function 'nextSuit' [-Wimplicit-function-declaration]
   26 |     A[i].suit = nextSuit();
      |                 ^~~~~~~~
main.c: At top level:
main.c:81:6: error: conflicting types for 'nextSuit'; have 'char(void)'
   81 | char nextSuit(void) {
      |      ^~~~~~~~
main.c:26:17: note: previous implicit declaration of 'nextSuit' with type 'int()'
   26 |     A[i].suit = nextSuit();
      |                 ^~~~~~~~
Language: C

#include<stdio.h>
#define Max 100000
#define INF 2000000000

struct Card{
  char suit;
  int value;
};

struct Card L[Max/2+2];
struct Card R[Max/2+2];

void merge(struct Card A[],int n,int l,int m,int r){
  int i,j,k;
  int n1 = m - l;
  int n2 = r - m;

  for(i=0 ; i<n1 ; i++) L[i] = A[l+i];
  for(i=0 ; i<n2 ; i++) R[i] = A[m+i];
  L[n1].value = R[n2].value = INF;
  i = j = 0;
  for(k=l ; k<r ; k++){
    if(L[i].value <= R[j].value) A[k] = L[i++];
    else A[k] = R[j++];
  }
}

void mergeSort(struct Card[],int n,int l,int r){
  int m;
  if(l+1 < r){
    m = (l+r)/2;
    mergeSort(A,n,l,m);
    mergeSort(A,n,m,r);
    merge(A,n,m,r);
  }
}

int partition(struct Card[],int n,int p,int r){
  int i,j;
  struct Card t,x;
  x = A[r];
  i = p-1;
  for(j=p ; j<r ; j++){
    if(A[j].value <= x.value){
      i++;
      t = A[i];
      A[i] = A[j];
      A[r] = t;
    }
  }
  t = A[i+1];
  A[i+1] = A[r];
  A[r] = t;
  return i+1;
} 

void quickSort(Struct Card A[],int n,int p,int r){
  int q;
  if(p < r){
    q = partition(A,n,p,r);
    quickSort(A,n,p,q-1);
    quickSort(A,n,q+1,r);
  }
}

int main(){
  int n,i,v;
  struct Card A[Max];
  struct Card B[Max];
  char S[10];
  int st = 1;

  scanf("%d",&n);

  for(i=0 ; i<n ; i++){
    scanf("%s %d",S,&v);
    A[i].suit = S[0];
    A[i].value = v;
    B[i].suit = S[0];
    B[i].value = v;
  }

  mergeSort(A,n,0,n);
  quickSort(B,n,0,n-1);

  for(i=0 ; i<n ; i++) if(A[i].suit != B[i].suit) st=0;

  if(st == 1) printf("Stable\n");
  else printf("Not stable\n");
  for(i=0 ; i<n ; i++) printf("%c %d\n",B[i].suit,B[i].value);

  return 0;
}

Compiler output:
main.c: In function 'mergeSort':
main.c:32:15: error: 'A' undeclared (first use in this function)
   32 |     mergeSort(A,n,l,m);
      |               ^
main.c:32:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:5: error: too few arguments to function 'merge'
   34 |     merge(A,n,m,r);
      |     ^~~~~
main.c:13:6: note: declared here
   13 | void merge(struct Card A[],int n,int l,int m,int r){
      |      ^~~~~
main.c: In function 'partition':
main.c:41:7: error: 'A' undeclared (first use in this function)
   41 |   x = A[r];
      |       ^
main.c: At top level:
main.c:57:16: error: unknown type name 'Struct'; did you mean 'struct'?
   57 | void quickSort(Struct Card A[],int n,int p,int r){
      |                ^~~~~~
      |                struct
main.c: In function 'main':
main.c:84:3: error: implicit declaration of function 'quickSort' [-Wimplicit-function-declaration]
   84 |   quickSort(B,n,0,n-1);
      |   ^~~~~~~~~
Language: C

#include<stdio.h>
#include<math.h>

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

Partition(card A[], int p, int r){
  int j;
  int x = A[r].number;
  int i = p-1;
  card a;
  for(j = p;j < r;j++){
    if(A[j].number <= x){
      i++;
      a = A[i], A[i] = A[j], A[j] = a;
  }
  a = A[i+1], A[i+1] = A[r], A[r] = a;
  return i+1;
}

Quicksort(card A[], int p, int r){
  int q;
  if(p < r){
    q = Partition(A, p, r);
    Quicksort(A, p, q-1);
    Quicksort(A, q+1, r);
  }
}

merge(card A[], int left, int mid, int right){
  int n1 = mid - left;
  int n2 = right - mid;
  int i, j, k;
  card L[n1 + 1], R[n2 + 1];
  for(i = 0;i < n1;i++)
    L[i] = A[left + i];
  for(i=0;i<n2;i++)
    R[i] = A[mid + i];
  L[n1].number = INFINITY;
  R[n2].number = INFINITY;
  i = 0;
  j = 0;
  for(k = left;k < right;k++){
    if(L[i].number <= R[j].number){
      A[k] = L[i];
      i++;
    } else {
      A[k] = R[j];
      j++;
    }
  }
}

mergeSort(card A[], int left, int right){
  if(left + 1 <right{
    int mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void){
  int n, i;
  scanf("%d", &n);
  card A[n], B[n], C[n];
  for(i=0;i<n;i++)
    scanf("%s %d", &A[i].suit, &A[i].number);
  for(i=0;i<n;i++)
    B[i] = A[i], C[i] = A[i];
  Quicksort(B, 0, n-1);
  mergeSort(C, 0, n);
  i = 0;
  while(i<n){
    if(B[i].suit == C[i].suit && B[i].number == C[i].number)
      i++;
  }
  if(i == n)
    printf("Stable\n");
  else
    printf("Not Stable\n");
  for(i=0;i<n;i++)
    printf("%s %d\n", B[i].suit, B[i].number);
  return 0;
}

Compiler output:
main.c:9:1: error: return type defaults to 'int' [-Wimplicit-int]
    9 | Partition(card A[], int p, int r){
      | ^~~~~~~~~
main.c: In function 'Partition':
main.c:23:1: error: implicit declaration of function 'Quicksort' [-Wimplicit-function-declaration]
   23 | Quicksort(card A[], int p, int r){
      | ^~~~~~~~~
main.c:23:11: error: expected expression before 'card'
   23 | Quicksort(card A[], int p, int r){
      |           ^~~~
main.c:23:34: error: expected ';' before '{' token
   23 | Quicksort(card A[], int p, int r){
      |                                  ^
      |                                  ;
main.c:87:1: error: expected declaration or statement at end of input
   87 | }
      | ^
Language: C

#include<stdio.h>
#include<math.h>

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

Partition(card A[], int p, int r){
  int j;
  int x = A[r].number;
  int i = p-1;
  card a;
  for(j = p;j < r;j++){
    if(A[j].number <= x){
      i++;
      a = A[i], A[i] = A[j], A[j] = a;
    }
  }
  a = A[i+1], A[i+1] = A[r], A[r] = a;
  return i+1;
}

Quicksort(card A[], int p, int r){
  int q;
  if(p < r){
    q = Partition(A, p, r);
    Quicksort(A, p, q-1);
    Quicksort(A, q+1, r);
  }
}

merge(card A[], int left, int mid, int right){
  int n1 = mid - left;
  int n2 = right - mid;
  int i, j, k;
  card L[n1 + 1], R[n2 + 1];
  for(i = 0;i < n1;i++)
    L[i] = A[left + i];
  for(i=0;i<n2;i++)
    R[i] = A[mid + i];
  L[n1].number = INFINITY;
  R[n2].number = INFINITY;
  i = 0;
  j = 0;
  for(k = left;k < right;k++){
    if(L[i].number <= R[j].number){
      A[k] = L[i];
      i++;
    } else {
      A[k] = R[j];
      j++;
    }
  }
}

mergeSort(card A[], int left, int right){
  if(left + 1 <right{
    int mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void){
  int n, i;
  scanf("%d", &n);
  card A[n], B[n], C[n];
  for(i=0;i<n;i++)
    scanf("%s %d", &A[i].suit, &A[i].number);
  for(i=0;i<n;i++)
    B[i] = A[i], C[i] = A[i];
  Quicksort(B, 0, n-1);
  mergeSort(C, 0, n);
  i = 0;
  while(i<n){
    if(B[i].suit == C[i].suit && B[i].number == C[i].number)
      i++;
  }
  if(i == n)
    printf("Stable\n");
  else
    printf("Not Stable\n");
  for(i=0;i<n;i++)
    printf("%s %d\n", B[i].suit, B[i].number);
  return 0;
}

Compiler output:
main.c:9:1: error: return type defaults to 'int' [-Wimplicit-int]
    9 | Partition(card A[], int p, int r){
      | ^~~~~~~~~
main.c:24:1: error: return type defaults to 'int' [-Wimplicit-int]
   24 | Quicksort(card A[], int p, int r){
      | ^~~~~~~~~
main.c:33:1: error: return type defaults to 'int' [-Wimplicit-int]
   33 | merge(card A[], int left, int mid, int right){
      | ^~~~~
main.c: In function 'merge':
main.c:42:18: warning: overflow in conversion from 'float' to 'int' changes value from '+Inff' to '2147483647' [-Woverflow]
   42 |   L[n1].number = INFINITY;
      |                  ^~~~~~~~
main.c:43:18: warning: overflow in conversion from 'float' to 'int' changes value from '+Inff' to '2147483647' [-Woverflow]
   43 |   R[n2].number = INFINITY;
      |                  ^~~~~~~~
main.c: At top level:
main.c:57:1: error: return type defaults to 'int' [-Wimplicit-int]
   57 | mergeSort(card A[], int left, int right){
      | ^~~~~~~~~
main.c: In function 'mergeSort':
main.c:58:21: error: expected ')' before '{' token
   58 |   if(left + 1 <right{
      |     ~               ^
      |                     )
main.c:64:1: error: expected expression before '}' token
   64 | }
      | ^
Language: C

#include <stdio.h>
#define MAX 100000
#define SENTINEL 2000000000

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

card L[MAX / 2 + 2],R[MAX / 2 + 2];

void merge(card A[],int n, int left, int mid, int right)
{
	int i,j,k;
	int n1 = mid - left;
	int n2 = right - mid;
	for(i = 0; i < n1; i++) L[i] = A[left + i];
	for(i = 0; i < n2; i++) R[i] = A[mid + i];
	L[n1].value = R[n2].value = SENTINEL;
	i = j = 0;
	for(k = left; k < right; k++)
	{
		if(L[i].value <= R[i].value)
		{
			A[k] = L[i++];
		} else {
			A[k] = R[j++];
		}
	}
}

void mergeSort(card A[], int n, int left, int right)
{
	int mid;
	if(left + 1 < right)
	{
		mid = (left + right) / 2;
		mergeSort(A,n,left,mid);
		mergeSoft(A,n,mid,right);
		merge(A,n,left,mid,right);
	}
}

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

void quickSort(card A[],int n, int p, int r)
{
	int q;
	if(p > r)
	{
		q = partition(A,n,p,r);
		quickSort(A,n,p,q - 1);
		quickSort(A,n,q + 1,r);
	}
}

int main()
{
	int n,i,v;
	card A[MAX],B[MAX];
	char S[10];
	int stable = 1;
	
	scanf("%d",&n);
	
	for(i = 0; i < n; i++)
	{
		scanf("%s %d",S,&v);
		A[i].suit = B[i].suit = S[0];
		A[i].value = B[i].value = v;
	}
	
	mergeSort(A,n,0,n);
	quickSort(B,n,0,n - 1);
	
	for(i = 0; i < n; i++)
	{
		if(A[i].suit != B[i].suit)
		{
			stable = 0;
			break;
		}
	}
	
	if(stable == 1) printf("Stable\n");
	else printf("Not stable\n");
	for(i = 0; i < n; i++)
	{
		printf("%s %d\n",B[i].suit,B[i].value);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'mergeSort':
main.c:39:17: error: implicit declaration of function 'mergeSoft'; did you mean 'mergeSort'? [-Wimplicit-function-declaration]
   39 |                 mergeSoft(A,n,mid,right);
      |                 ^~~~~~~~~
      |                 mergeSort