Language: C

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

//int A[N];

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

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

int partition(Card A[], int p, int r){
  int i, j, 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[], inr p, int r){
  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[], inr 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:12:8: error: 'MAX' undeclared here (not in a function)
   12 | Card L[MAX/2+2], R[MAX/2+2];
      |        ^~~
main.c: In function 'partition':
main.c:17:7: error: incompatible types when assigning to type 'int' from type 'Card'
   17 |   x = A[r];
      |       ^
main.c:20:12: error: invalid operands to binary <= (have 'Card' and 'int')
   20 |     if(A[j]<=x){
      |        ~~~~^~
      |         |
      |         Card
main.c:22:15: error: incompatible types when assigning to type 'int' from type 'Card'
   22 |       temp1 = A[i];
      |               ^
main.c:24:14: error: incompatible types when assigning to type 'Card' from type 'int'
   24 |       A[j] = temp1;
      |              ^~~~~
main.c:27:11: error: incompatible types when assigning to type 'int' from type 'Card'
   27 |   temp2 = A[i+1];
      |           ^
main.c:29:10: error: incompatible types when assigning to type 'Card' from type 'int'
   29 |   A[r] = temp2;
      |          ^~~~~
main.c: At top level:
main.c:33:26: error: unknown type name 'inr'; did you mean 'int'?
   33 | void quicksort(Card A[], inr p, int r){
      |                          ^~~
      |                          int
main.c: In function 'merge':
main.c:46:14: error: 'N2' undeclared (first use in this function); did you mean 'n2'?
   46 |   for(i=0; i<N2; i++) R[i] = A[m+i];
      |              ^~
      |              n2
main.c:46:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:58:26: error: unknown type name 'inr'; did you mean 'int'?
   58 | void mergeSort(Card A[], inr l, int r){
      |                          ^~~
      |                          int
main.c: In function 'main':
main.c:3:11: error: expected identifier or '(' before numeric constant
    3 | #define S 200000000
      |           ^~~~~~~~~
main.c:71:8: note: in expansion of macro 'S'
   71 |   char S[10];
      |        ^
main.c:84:3: error: implicit declaration of function 'mergesort' [-Wimplicit-function-declaration]
   84 |   mergesort(A, 0, n);
      |   ^~~~~~~~~
main.c:85:3: error: implicit declaration of function 'quicksort' [-Wimplicit-function-declaration]
   85 |   quicksort(B, 0, n-1);
      |   ^~~~~~~~~
main.c:88:14: error: expected ')' before '!' token
   88 |     if(A[i].m !- B[i].m) stable = 0;
      |       ~      ^~
      |              )