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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");

        Card[] cardsBubble = bubbleSort(getCards(datas,n),n);
        System.out.println("Stable");
        Card[] cardsSelect = selectionSort(getCards(datas,n),n);
        isStable(cardsBubble, cardsSelect, n);
	}



	private static void isStable(Card[] cardsBubble, Card[] cardsSelect, int n) {
		boolean stable=true;
		for(int i=0; i<n; i++){
			if(!cardsBubble[i].suit.equals(cardsSelect[i].suit)){
				stable = false;
				break;
			}
		}
		if(stable){
			System.out.println("Stable");
		}else{
			System.out.println("Not stable");
		}
	}



	private static Card[] getCards(String[] datas, int n) {
		Card[] cards = new Card[n];
		for(int i=0; i<datas.length; i++){
			cards[i] = new Card(datas[i].substring(0, 1), Integer.parseInt(datas[i].substring(1, 2)));
		}
		return cards;
	}

	static class Card{
		public String suit;
		public int value;
		public Card(String suit, int value){
			this.suit = suit;
			this.value = value;
		}
		public Card(){
		}
	}


	private static Card[] bubbleSort(Card[] cards, int n) {
		boolean flag = true;
		for(int i=0; flag==true; i++){
			flag = false;
			//bubble sort
			for(int j=0; j<n-1; j++){
				if(cards[j].value > cards[j+1].value){
					Card tmp = new Card(cards[j].suit, cards[j].value);
					cards[j] = cards[j+1];
					cards[j+1] = tmp;
					flag = true;
				}
			}
		}
		disp(cards,n);
		return cards;
	}


	private static Card[] selectionSort(Card[] cards, int n) {
		for(int i=0; i<n; i++){
			int minj= i;
			for(int j=i; j<n; j++){
				if(cards[j].value < cards[minj].value) minj = j;
			}
			//???????????????????§??????????????´???¨????°?????´????????????????
			Card tmp = new Card(cards[i].suit, cards[i].value);
			cards[i] = cards[minj];
			cards[minj] = tmp;
		}
		disp(cards,n);
		return cards;
	}



	private static void disp(Card[] cards, int n) {
		for (int i = 0; i < n; i++) {
			System.out.print(cards[i].suit + cards[i].value);
			if(i!=n-1)System.out.print(" ");
		}
		System.out.println();
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static int N; //static?????´??°???public static???main?????????????????§????????????????????????

	public static void main(String[] args){

		N = scan.nextInt();
		String[] cards = new String[N];
		String[] copys = new String[N];
		String[] ins = new String[N];
		for(int i = 0; i < N; i++){
			cards[i] = scan.next();
			copys[i] = cards[i];
			ins[i] = cards[i];
		}

		//?????????????????????????????????????????????
		for(int i = 0; i < N; i++){
			for(int j = N-1; j >= i+1; j--){
				String sj = cards[j].substring(1);
				String sjj = cards[j-1].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj){
					String work = cards[j];
					cards[j] = cards[j-1];
					cards[j-1] = work;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", cards[i]);
		System.out.printf("%s\n", Arrays.equals(ins, carsd)? "Stable" : "Not stable");

		//???????????????
		for(int i = 0; i < N; i++){
			int minj = i;
			for(int j = i; j < N; j++){
				String sj = copys[j].substring(1);
				String sjj = copys[minj].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj)
					minj = j;
			}
			//?????????????????????minj??¨i???????????????
			if(minj != i){
				String work = copys[minj];
				copys[minj] = copys[i];
				copys[i] = work;
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", copys[i]);
		System.out.printf("%s\n", Arrays.equals(ins, copys)? "Stable" : "Not stable");
	}
}

Compiler output:
Main.java:36: error: cannot find symbol
		System.out.printf("%s\n", Arrays.equals(ins, carsd)? "Stable" : "Not stable");
		                                             ^
  symbol:   variable carsd
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static int N; //static?????´??°???public static???main?????????????????§????????????????????????

	public static void main(String[] args){

		N = scan.nextInt();
		String[] cards = new String[N];
		String[] copys = new String[N];
		int[] nary = new int[N];
		boolean stable;
		for(int i = 0; i < N; i++){
			cards[i] = scan.next();
			copys[i] = cards[i];
			nary[i] = i;
		}

		//?????????????????????????????????????????????
		for(int i = 0; i < N; i++){
			for(int j = N-1; j >= i+1; j--){
				String sj = cards[j].substring(1);
				String sjj = cards[j-1].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj){
					String work = cards[j];
					cards[j] = cards[j-1];
					cards[j-1] = work;
					int nwork = nary[j]
					nary[j] = nary[j-1];
					nary[j-1] = work;
				}
			}
		}

		stable = true;
		for(int i = 0; i < n-1; i++){
			if(cardComp(cards[i], card[i+1]) == 0){
				if(nary[i] > nary[i+1]{
					stable = false;
					break;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", cards[i]);
		System.out.printf("%s\n", stable? "Stable" : "Not stable");

		//???????????????
		for(int i = 0; i < N; i++){
			int minj = i;
			for(int j = i; j < N; j++){
				String sj = copys[j].substring(1);
				String sjj = copys[minj].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj)
					minj = j;
			}
			//?????????????????????minj??¨i???????????????
			if(minj != i){
				String work = copys[minj];
				copys[minj] = copys[i];
				copys[i] = work;
				int nwork = nary[minj];
				nary[minj] = nary[i];
				nary[i] = nwork;
			}
		}

		stable = true;
		for(int i = 0; i < n-1; i++){
			if(cardComp(cards[i], card[i+1]) == 0){
				if(nary[i] > nary[i+1]){
					stable = false;
					break;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", copys[i]);
		System.out.printf("%s\n", stable? "Stable" : "Not stable");
	}

	private static int cardComp(String left, String right){
		char l = left.charAt(1);
		char r = right.charAt(1);
		return (l-r);
	}
}

Compiler output:
Main.java:31: error: ';' expected
					int nwork = nary[j]
					                   ^
Main.java:41: error: ')' expected
				if(nary[i] > nary[i+1]{
				                      ^
2 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static int N; //static?????´??°???public static???main?????????????????§????????????????????????

	public static void main(String[] args){

		N = scan.nextInt();
		String[] cards = new String[N];
		String[] copys = new String[N];
		int[] nary = new int[N];
		boolean stable;
		for(int i = 0; i < N; i++){
			cards[i] = scan.next();
			copys[i] = cards[i];
			nary[i] = i;
		}

		//?????????????????????????????????????????????
		for(int i = 0; i < N; i++){
			for(int j = N-1; j >= i+1; j--){
				String sj = cards[j].substring(1);
				String sjj = cards[j-1].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj){
					String work = cards[j];
					cards[j] = cards[j-1];
					cards[j-1] = work;
					int nwork = nary[j];
					nary[j] = nary[j-1];
					nary[j-1] = work;
				}
			}
		}

		stable = true;
		for(int i = 0; i < n-1; i++){
			if(cardComp(cards[i], card[i+1]) == 0){
				if(nary[i] > nary[i+1]){
					stable = false;
					break;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", cards[i]);
		System.out.printf("%s\n", stable? "Stable" : "Not stable");

		//???????????????
		for(int i = 0; i < N; i++){
			int minj = i;
			for(int j = i; j < N; j++){
				String sj = copys[j].substring(1);
				String sjj = copys[minj].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj)
					minj = j;
			}
			//?????????????????????minj??¨i???????????????
			if(minj != i){
				String work = copys[minj];
				copys[minj] = copys[i];
				copys[i] = work;
				int nwork = nary[minj];
				nary[minj] = nary[i];
				nary[i] = nwork;
			}
		}

		stable = true;
		for(int i = 0; i < n-1; i++){
			if(cardComp(cards[i], card[i+1]) == 0){
				if(nary[i] > nary[i+1]){
					stable = false;
					break;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", copys[i]);
		System.out.printf("%s\n", stable? "Stable" : "Not stable");
	}

	private static int cardComp(String left, String right){
		char l = left.charAt(1);
		char r = right.charAt(1);
		return (l-r);
	}
}

Compiler output:
Main.java:33: error: incompatible types: String cannot be converted to int
					nary[j-1] = work;
					            ^
Main.java:39: error: cannot find symbol
		for(int i = 0; i < n-1; i++){
		                   ^
  symbol:   variable n
  location: class Main
Main.java:40: error: cannot find symbol
			if(cardComp(cards[i], card[i+1]) == 0){
			                      ^
  symbol:   variable card
  location: class Main
Main.java:75: error: cannot find symbol
		for(int i = 0; i < n-1; i++){
		                   ^
  symbol:   variable n
  location: class Main
Main.java:76: error: cannot find symbol
			if(cardComp(cards[i], card[i+1]) == 0){
			                      ^
  symbol:   variable card
  location: class Main
5 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static int N; //static?????´??°???public static???main?????????????????§????????????????????????

	public static void main(String[] args){

		N = scan.nextInt();
		String[] cards = new String[N];
		String[] copys = new String[N];
		int[] nary = new int[N];
		boolean stable;
		for(int i = 0; i < N; i++){
			cards[i] = scan.next();
			copys[i] = cards[i];
			nary[i] = i;
		}

		//?????????????????????????????????????????????
		for(int i = 0; i < N; i++){
			for(int j = N-1; j >= i+1; j--){
				String sj = cards[j].substring(1);
				String sjj = cards[j-1].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj){
					String work = cards[j];
					cards[j] = cards[j-1];
					cards[j-1] = work;
					int nwork = nary[j];
					nary[j] = nary[j-1];
					nary[j-1] = nwork;
				}
			}
		}

		stable = true;
		for(int i = 0; i < N-1; i++){
			if(cardComp(cards[i], card[i+1]) == 0){
				if(nary[i] > nary[i+1]){
					stable = false;
					break;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", cards[i]);
		System.out.printf("%s\n", stable? "Stable" : "Not stable");

		//???????????????
		for(int i = 0; i < N; i++){
			int minj = i;
			for(int j = i; j < N; j++){
				String sj = copys[j].substring(1);
				String sjj = copys[minj].substring(1);
				int vj = Integer.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj)
					minj = j;
			}
			//?????????????????????minj??¨i???????????????
			if(minj != i){
				String work = copys[minj];
				copys[minj] = copys[i];
				copys[i] = work;
				int nwork = nary[minj];
				nary[minj] = nary[i];
				nary[i] = nwork;
			}
		}

		stable = true;
		for(int i = 0; i < N-1; i++){
			if(cardComp(copys[i], copys[i+1]) == 0){
				if(nary[i] > nary[i+1]){
					stable = false;
					break;
				}
			}
		}

		for(int i = 0; i < N; i++)
			System.out.printf(i != N-1? "%s " : "%s\n", copys[i]);
		System.out.printf("%s\n", stable? "Stable" : "Not stable");
	}

	private static int cardComp(String left, String right){
		char l = left.charAt(1);
		char r = right.charAt(1);
		return (l-r);
	}
}

Compiler output:
Main.java:40: error: cannot find symbol
			if(cardComp(cards[i], card[i+1]) == 0){
			                      ^
  symbol:   variable card
  location: class Main
1 error
Language: Java

package aoj;

import java.util.*;
public class StableSort {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		int circle=input.nextInt();
		char[][] arr=new char[circle][2];
		char[][] arr1=new char[circle][2];
		String[] afterArr=new String[circle];
		String[] afterArr1=new String[circle];
		for(int i=0;i<circle;i++){
			String str=input.next();
			arr[i][1]=str.charAt(0);
			arr[i][0]=str.charAt(1);
		}
		for(int i=0;i<arr.length;i++){
			arr1[i][0]=arr[i][0];
			arr1[i][1]=arr[i][1];
		}
		arr=bubbleSort(arr);
		arr1=selectionSort(arr1);
		for(int i=0;i<afterArr.length;i++){
			afterArr[i]=String.valueOf(arr[i]);
			afterArr1[i]=String.valueOf(arr1[i]);
		}
		print(afterArr);
		System.out.println("Stable");
		print(afterArr1);
		if(isStable(afterArr,afterArr1))
			System.out.println("Stable");
		else
			System.out.println("Not Stable");
	}
	
	public static char[][] bubbleSort(char[][] arr){
		for(int k=0;k<arr.length-1;k++){
			for(int n=0;n<arr.length-1-k;n++){
				if(arr[n+1][0]<arr[n][0]){
					char change=arr[n+1][0];
					arr[n+1][0]=arr[n][0];
					arr[n][0]=change;
				}
			}
			
		}
		return arr;
	}
	
	public static char[][] selectionSort(char[][] arr){
		
		for(int k=0;k<arr.length-1;k++){
			for(int n=k+1;n<arr.length;n++){
				if(arr[n][0]<arr[k][0]){
					char change=arr[n][0];
					arr[n][0]=arr[k][0];
					arr[k][0]=change;
				}
			}
			
		}
		
		return arr;
	}
	
	public static boolean isStable(String[] arr1,String[] arr2){
		for(int i=0;i<arr1.length;i++){
			if(arr1[i]!=arr2[i])
				return false;
		}
		
		return true;
	}
	
	public static void print(String[] arr){
		for(int i=0;i<arr.length;i++){
			if(i==arr.length-1)
				System.out.println(arr[i]);
			else
				System.out.print(arr[i]+" ");
		}
	}

}

Compiler output:
Main.java:4: error: class StableSort is public, should be declared in a file named StableSort.java
public class StableSort {
       ^
1 error
Language: Java

import java.util.*;
public class StableSort {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		int circle=input.nextInt();
		char[][] arr=new char[circle][2];
		char[][] arr1=new char[circle][2];
		String[] afterArr=new String[circle];
		String[] afterArr1=new String[circle];
		for(int i=0;i<circle;i++){
			String str=input.next();
			arr[i][1]=str.charAt(0);
			arr[i][0]=str.charAt(1);
		}
		for(int i=0;i<arr.length;i++){
			arr1[i][0]=arr[i][0];
			arr1[i][1]=arr[i][1];
		}
		arr=bubbleSort(arr);
		arr1=selectionSort(arr1);
		for(int i=0;i<afterArr.length;i++){
			afterArr[i]=String.valueOf(arr[i]);
			afterArr1[i]=String.valueOf(arr1[i]);
		}
		print(afterArr);
		System.out.println("Stable");
		print(afterArr1);
		if(isStable(afterArr,afterArr1))
			System.out.println("Stable");
		else
			System.out.println("Not Stable");
	}
	
	public static char[][] bubbleSort(char[][] arr){
		for(int k=0;k<arr.length-1;k++){
			for(int n=0;n<arr.length-1-k;n++){
				if(arr[n+1][0]<arr[n][0]){
					char change=arr[n+1][0];
					arr[n+1][0]=arr[n][0];
					arr[n][0]=change;
				}
			}
			
		}
		return arr;
	}
	
	public static char[][] selectionSort(char[][] arr){
		
		for(int k=0;k<arr.length-1;k++){
			for(int n=k+1;n<arr.length;n++){
				if(arr[n][0]<arr[k][0]){
					char change=arr[n][0];
					arr[n][0]=arr[k][0];
					arr[k][0]=change;
				}
			}
			
		}
		
		return arr;
	}
	
	public static boolean isStable(String[] arr1,String[] arr2){
		for(int i=0;i<arr1.length;i++){
			if(arr1[i]!=arr2[i])
				return false;
		}
		
		return true;
	}
	
	public static void print(String[] arr){
		for(int i=0;i<arr.length;i++){
			if(i==arr.length-1)
				System.out.println(arr[i]);
			else
				System.out.print(arr[i]+" ");
		}
	}

}

Compiler output:
Main.java:2: error: class StableSort is public, should be declared in a file named StableSort.java
public class StableSort {
       ^
1 error
Language: Java

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

public class Main {
  public static void main(String args[] ) throws IOException {
    BufferedReader br = new BufferedReader(new InputStream(System.in));

    int N = Integer.parseInt(br.readLine());
    String[] bCards = br.readLine().split(" ");
    String[] cCards = bCards.clone();

    System.out.println(toStr(bubbleSort(bCards, N)) + "\nStable");
    System.out.println(toStr(selectionSort(cCards, N)));
    System.out.println(Arrays.equals(bCards, cCards) ? "Stable" : "Not stable");
  }

  private static String[] bubbleSort(String[] cards, int N) {
    for (int i=0;i<N;i++) {
      for (int j=N-1;j>i;j--) {
        if(toInt(cards[j]) < toInt(cards[j-1])){
          String tmp = cards[j];
          cards[j] = cards[j-1];
          cards[j-1] = tmp;
        }
      }
    }
    return cards;
  }

  private static String[] selectionSort(String[] cards, int N) {
    for (int i=0;i<N;i++) {
      int minj = i;
      for (int j=i;j<N;j++) {
        if(toInt(cards[j]) < toInt(cards[minj])){
          minj = j;
        }
      }
      String tmp = cards[i];
      cards[i] = cards[minj];
      cards[minj] = tmp;
    }
    return cards;
  }

  private static int toInt(String card) {
    return Integer.parseInt(card.substring(1));    
  }

  private static String toStr(String[] cards) {
    StringBuilder sb = new StringBuilder();
    for (String card : cards) {
      sb.append(card).append(" ");
    }
    return sb.toString().trim();
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
    BufferedReader br = new BufferedReader(new InputStream(System.in));
                                               ^
  symbol:   class InputStream
  location: class Main
1 error
Language: Java

import java.util.*;

public class Stable {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Card[] a1 = new Card[N];
        Card[] a2 = new Card[N];
        for (int i = 0; i < N; i++) {
            Card c = new Card(sc.next());
            a1[i] = c;
            a2[i] = c;
        }
        bubble(a1);
        selectionSort(a2);
        String s1 = result(a1);
        String s2 = result(a2);
        System.out.println(s1);
        System.out.println("Stable");
        System.out.println(s2);
        System.out.println(s1.equals(s2) ? "Stable" : "Not stable");


    }

    private static void bubble(Card[] a) {
        for(int i = 0; i < a.length; i++ ) {
            for(int j = a.length -1; j > i; i--){
                if(a[j].n < a[j - 1].n) {
                    Card t = a[j - 1];
                    a[j - 1] = a[j];
                    a[j] = t;
                }
            }
        }
    }

    private static void selectionSort(Card[] a) {
        for (int i = 0; i < a.length; i++) {
            int mi = i;
            for (int j = i + 1; j < a.length; j++) {
                if (a[j].n < a[mi].n) {
                    mi = j;
                }
            }
            if (i != mi) {
                Card t = a[i];
                a[i] = a[mi];
                a[mi] = t;
            }
        }
    }

    private static String result(Card[] a) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < a.length; i++) {
            sb.append(a[i].toString());
            if (i != a.length - 1) {
                sb.append(" ");
            }
        }
        return sb.toString();
    }

    public static class Card {
        String m;
        int n;

        private Card(String s) {
            // return char as string
            this.m = String.valueOf(s.charAt(0));
            // return int that specified as Unicode
            this.n = Character.getNumericValue(s.charAt(1));
        }

        public String toString() {
            return m + String.valueOf(n);
        }
    }
}



Compiler output:
Main.java:3: error: class Stable is public, should be declared in a file named Stable.java
public class Stable {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Scanner;
import java.util.Deque;
import java.util.ArrayDeque;

public class pr_2_C_is_stable_sort {
	
	public static <E> void print_array(E[] arr){
		int i=0;
		for(E element: arr){
			System.out.print(element);
			if(i != arr.length-1) System.out.print(" ");
			else System.out.print("\n");
			i++;
		}
	}
	
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String tmp_arr[] = new String[n];
		tmp_arr = br.readLine().split(" ");
		String tmp_arr1[] = new String[n];
		String base_arr[] = new String[n];
		
		// srcPos: beginning in tmp_arr, destPos: beginning in tmp_arr1
		System.arraycopy(tmp_arr, 0, base_arr, 0, n);		
		System.arraycopy(tmp_arr, 0, tmp_arr1, 0, n);
		
		String[] bubbled_arr = bubblesort(tmp_arr);
		print_array(bubbled_arr);
		if(check_stable(bubbled_arr, base_arr)) System.out.println("Stable");
		else System.out.println("Not stable");
		String[] selected_arr = selectionsort(tmp_arr1);
		print_array(selected_arr);
		if(check_stable(selected_arr, base_arr)) System.out.println("Stable"); 		
		else System.out.println("Not stable");

	}	
	
	public static String[] bubblesort(String[] arr){
		int n = arr.length;
		for(int i=0; i<n; i++){
			for(int j=1; j<n-i; j++){
				if(Character.getNumericValue(arr[j-1].charAt(1)) > Character.getNumericValue((arr[j].charAt(1)))){
					String tmp = arr[j-1];
					arr[j-1] = arr[j];
					arr[j] = tmp;
				}
			}
		}		
		return arr;
	}
	
	public static String[] selectionsort(String[] arr){
		for(int i=0; i<arr.length; i++){
			int min_ix = i;
			for(int j=i; j<arr.length; j++){
				if(Character.getNumericValue(arr[min_ix].charAt(1)) > Character.getNumericValue(arr[j].charAt(1))) min_ix = j;
			}
			if(min_ix != i){
				// swap
				String tmp = arr[min_ix];
				arr[min_ix] = arr[i];
				arr[i] = tmp;
			}
		}
		return arr;
	}
	public static boolean check_stable(String[] arr, String[] sorted_arr){
		int n = arr.length;
		for(int checknum=1; checknum<10; checknum++){
			String[] check_bff_1 = new String[n];
			String[] check_bff_2 = new String[n];
			
			int bff_ix_1 = 0;
			int bff_ix_2 = 0;
			
			for(int i=0; i<n; i++){
				if (Character.getNumericValue(sorted_arr[i].charAt(1)) == checknum){
					check_bff_1[bff_ix_1] = sorted_arr[i];
					bff_ix_1++;
				}
				if (Character.getNumericValue(arr[i].charAt(1)) == checknum){
					check_bff_2[bff_ix_2] = arr[i];
					bff_ix_2++;
				}
			}
			for(int j=0; j<n; j++){
				if(check_bff_1[j] == null && check_bff_2[j] == null) continue;
				if(check_bff_1[j] != check_bff_2[j]) return false;
			}
		}
		return true;
	}
}
		


Compiler output:
Main.java:8: error: class pr_2_C_is_stable_sort is public, should be declared in a file named pr_2_C_is_stable_sort.java
public class pr_2_C_is_stable_sort {
       ^
1 error
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      String[] inArr = in.readLine().split(" ");
      String[] bArr = Sort.bubbleSort(inArr);
      String[] sArr = Sort.selectionSort(inArr);
      StringBuilder bubbleSb = new StringBuilder();
      for(String str : bArr) { bubbleSb.append(str).append(" "); }
      StringBuilder selectSb = new StringBuilder();
      for(String str : sArr) { selectSb.append(str).append(" "); }
      System.out.println(bubbleSb.toString().trim());
      System.out.println("Stable");
      System.out.println(selectSb.toString().trim());
      if(Sort.isStable(inArr, sArr)) {
        System.out.println("Stable");
      } else {
        System.out.println("Not stable");
      }
    } catch(IOException e) {
    }
  }
}

class Sort {
  public static String[] bubbleSort(String[] arr) {
    String[] bArr = arr.clone();
    for(int i = 0; i < bArr.length; i++) {
      for(int j = bArr.length-1; j > i, j--) {
        if(Sort.compCard(bArr[j], bArr[j-1]) == 2) {
          String tmp = bArr[j];
          bArr[j] = bArr[j-1];
          bArr[j-1] = tmp;
        }
      }
    }
    return bArr;
  }

  public static String[] selectionSort(String[] arr) {
    String[] sArr = arr.clone();
    for(int i=0; i<sArr.length; i++) {
      int minj = i;
      for(int j=i; j<sArr.length; j++) {
        if(Sort.compCard(sArr[minj], sArr[j]) == 1) { minj = j; }
      }
      if(i != minj) {
        String tmp = sArr[i];
        sArr[i] = sArr[minj];
        sArr[minj] = tmp;
      }
    }
    return sArr;
  }

  public static int compCard(String str1, String str2) {
    int i = Integer.parseInt(str1.substring(1));
    int j = Integer.parseInt(str2.substring(1));
    if(i > j) {
      return 1;
    } else if(i==j) {
      return 0;
    } else {
      return 2;
    }
  }

  public static boolean isStable(String[] in, String[] out) {
    int cnt = in.length;
    for(int i=0; i<cnt; i++) {
      for(int j=i+1; j<cnt; j++) {
        if(Sort.compCard(in[i], in[j])==0) {
          for(int k=0; k<cnt; k++) {
            for(int l=k+1; l<cnt; l++) {
              if(out[k].equals(in[j]) && out[l].equals(in[i])) {
                return false;
              }
            }
          }
        }
      }
    }
    return true;
  }
}


Compiler output:
Main.java:32: error: ';' expected
      for(int j = bArr.length-1; j > i, j--) {
                                      ^
1 error
Language: C

#include <stdio.h>

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

void print(Card C[], int N) {
    int i;
    for (i = 0; i < N; i++) {
        printf("%c%d", C[i].mark, C[i].value);
        if (i != N-1)
            printf(" ");
        else
            printf("\n");
    }
}

void BubbleSort(Card C[], int N) {
    int i, j;
    Card num;

    for (i = 0; i < N; i++) {
        for (j = N-1; j > i; j--) {
            if (C[j].value < C[j-1].value) {
                tmp = C[j];
                C[j] = C[j-1];
                C[j-1] = num;
            }
        }
    }
    print(C, N);
    printf("Stable\n");
}

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

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

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

    scanf("%d", &N);

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

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

    for(i = 0; i < N; i++) {
        if(C1[i].mark != C2[i].mark) {
            flag = 0;
            break;
        }
    }

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

    return 0;
}



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

#include<stdio.h>
struct card
{
  char num[2];
  char mark;
  int value;
};
int n;
char isStable(struct card in[], struct card out[])
{
  for(i = 0; i < n; i++)
    {
      if(b[i].value != c[i].value)
	{
	  return 0;
	}
    }
  return 1;
}
int main()
{
  int i, j, minj, k;
  struct card c[36], a[36], b[36], tmp;
  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%s", a[i].num);
      if(a[i].num[0] == 'H')
	{
	  a[i].mark = 'H';
	}
      else if(a[i].num[0] == 'S')
	{
	  a[i].mark = 'S';
	}
      else if(a[i].num[0] == 'C')
	{
	  a[i].mark = 'C';
	}
      else
	{
	  a[i].mark = 'D';
	}
      if(a[i].num[1] == '1')
	{
	  a[i].value = 1;
	}
      else if(a[i].num[1] == '2')
	{
	  a[i].value = 2;
	}
      else if(a[i].num[1] == '3')
	{
	  a[i].value = 3;
	}
      else if(a[i].num[1] == '4')
	{
	  a[i].value = 4;
	}
      else if(a[i].num[1] == '5')
	{
	  a[i].value = 5;
	}
      else if(a[i].num[1] == '6')
	{
	  a[i].value = 6;
	}
      else if(a[i].num[1] == '7')
	{
	  a[i].value = 7;
	}
      else if(a[i].num[1] == '8')
	{
	  a[i].value = 8;
	}
      else
	{
	  a[i].value = 9;
	}
      b[i] = a[i];
      c[i] = a[i];
    }
  for(i = 0; i <= n-1; i++)
    {
      for(j = n - 1; j >= i + 1; j--)
	{
	  if(c[j].value < c[j-1].value)
	    {
	      tmp = c[j];
	      c[j] = c[j-1];
	      c[j-1] = tmp;
	    }
	}
    }
    
  for(i = 0; i <= n-1; i++)
    {
      minj = i;
      for(j = i; j <= n-1; j++)
	{
	  if(b[j].value < b[minj].value)
	    {
	      minj = j;
	    }
	}
      tmp = b[i];
      b[i] = b[minj];
      b[minj] = tmp;
    }

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

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



Compiler output:
main.c: In function 'isStable':
main.c:11:7: error: 'i' undeclared (first use in this function); did you mean 'in'?
   11 |   for(i = 0; i < n; i++)
      |       ^
      |       in
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:10: error: 'b' undeclared (first use in this function)
   13 |       if(b[i].value != c[i].value)
      |          ^
main.c:13:24: error: 'c' undeclared (first use in this function)
   13 |       if(b[i].value != c[i].value)
      |                        ^
Language: C

#include<stdio.h>
struct card
{
  char num[2];
  char mark;
  int value;
};
int n;
char isStable(struct card in[], struct card out[])
{
  i = 0;
  for(i = 0; i < n; i++)
    {
      if(in[i].value != out[i].value)
	{
	  return 0;
	}
    }
  return 1;
}
int main()
{
  int i, j, minj, k;
  struct card c[36], a[36], b[36], tmp;
  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%s", a[i].num);
      if(a[i].num[0] == 'H')
	{
	  a[i].mark = 'H';
	}
      else if(a[i].num[0] == 'S')
	{
	  a[i].mark = 'S';
	}
      else if(a[i].num[0] == 'C')
	{
	  a[i].mark = 'C';
	}
      else
	{
	  a[i].mark = 'D';
	}
      if(a[i].num[1] == '1')
	{
	  a[i].value = 1;
	}
      else if(a[i].num[1] == '2')
	{
	  a[i].value = 2;
	}
      else if(a[i].num[1] == '3')
	{
	  a[i].value = 3;
	}
      else if(a[i].num[1] == '4')
	{
	  a[i].value = 4;
	}
      else if(a[i].num[1] == '5')
	{
	  a[i].value = 5;
	}
      else if(a[i].num[1] == '6')
	{
	  a[i].value = 6;
	}
      else if(a[i].num[1] == '7')
	{
	  a[i].value = 7;
	}
      else if(a[i].num[1] == '8')
	{
	  a[i].value = 8;
	}
      else
	{
	  a[i].value = 9;
	}
      b[i] = a[i];
      c[i] = a[i];
    }
  for(i = 0; i <= n-1; i++)
    {
      for(j = n - 1; j >= i + 1; j--)
	{
	  if(c[j].value < c[j-1].value)
	    {
	      tmp = c[j];
	      c[j] = c[j-1];
	      c[j-1] = tmp;
	    }
	}
    }
    
  for(i = 0; i <= n-1; i++)
    {
      minj = i;
      for(j = i; j <= n-1; j++)
	{
	  if(b[j].value < b[minj].value)
	    {
	      minj = j;
	    }
	}
      tmp = b[i];
      b[i] = b[minj];
      b[minj] = tmp;
    }

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

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



Compiler output:
main.c: In function 'isStable':
main.c:11:3: error: 'i' undeclared (first use in this function); did you mean 'in'?
   11 |   i = 0;
      |   ^
      |   in
main.c:11:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 36

void BubbleSort();
void SelectionSort();

char A[MAX][2],BS[MAX][2],SS[MAX][2];
int count=0,n;

int main(){

 	int i;

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

 		BubbleSort();
 		for( i = 0; i < n; i++) printf(" %s%d",BS[i],BS[0][1]);
 		printf("\nStable\n");
 			
 		SelectionSort();
 		for( i = 0; i < n; i++) printf("%s%d",SS[i][0],SS[i][1]);
 		if(count == 0) printf("\nStable\n");
 		else printf("\nNot Stable\n");	
 			
 		return 0;
}

void BubbleSort(){

	int swap,i,j;

	for( i = 0; i < n-1; i++){
		for( j = n-1; j >= i; j-- ){
			if(A[j] < A[j-1]){
				BS[j] = A[j-1];
				BS[j-1] = A[j];
			}
		}
	}
}

void SelectionSort(){

	int swap,minj,i,j;

	for(i = 0; i < n-2; i++){
		minj = i;
		for(j = i; j < n-1; j++){
			if(A[j] < A[minj]){
				minj = j;	
			}
		}
		if( i != minj){
			SS[i] = A[minj];
			SS[minj] = A[i];
		}
	}
}



Compiler output:
main.c: In function 'BubbleSort':
main.c:38:39: error: assignment to expression with array type
   38 |                                 BS[j] = A[j-1];
      |                                       ^
main.c:39:41: error: assignment to expression with array type
   39 |                                 BS[j-1] = A[j];
      |                                         ^
main.c: In function 'SelectionSort':
main.c:57:31: error: assignment to expression with array type
   57 |                         SS[i] = A[minj];
      |                               ^
main.c:58:34: error: assignment to expression with array type
   58 |                         SS[minj] = A[i];
      |                                  ^
Language: C

#include<stdio.h>


char card[36][2];
int number;


void bubble(){
  int i;



  for(i=0;i<number;i++){
    printf("%s ",   );
    printf("\n");}
}



void selection(){





}



int main(){
  
  int i;
  scanf("%d",&number);
  
  for(i=0;i<number;i++){
    scanf("%s",card[i]);
    
    
  }
  
   
  bubble();
  selection();
  

   return 0;
}



Compiler output:
main.c: In function 'bubble':
main.c:14:21: error: expected expression before ')' token
   14 |     printf("%s ",   );
      |                     ^
Language: C

#include<iostream>
using namespace std;

struct Card {char suit, value;};

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

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

void print(struct Card A[], int N) {
  for (int i=0; i<N; i++) {
    if (i) cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

// compare the resulting array of selection sort with always-stable resulting array of bubble sort.
bool isStable(struct Card C1[], struct Card C2[], int N) {
  for (int i=0; i<N; i++) {
    if (C1[i].suit != C2[i].suit) return false;
  }
  return true;
}

int main() {
  Card C1[100], C2[100];
  int N;
  char ch;

  cin >> N;
  for (int i=0; i<N; i++) {
    cin >> C1[i].suit >> C1[i].value;
  }
  for (int i=0; i<N; i++) C2[i] = C1[i];

  bubbleSort(C1, N);
  selectionSort(C2, N);

  print(C1, N);
  cout << "Stable" << endl;
  print(C2, N);
  if (isStable(C1, C2, N)) {
    cout << "Stable" << endl;
  } else {
    cout << "Not stable" << endl;
  }

  return 0;
}



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

#include<stdio.h>
 
 struct card{
           char gara[37];
           int kazu[37];
           };

 struct card card1;
 struct card card2;

 void bublle(struct card1.gara[],struct card1.kazu[],int n){
               int i,j,tmp,tmp2;
               for(i=0;i<n;i++){
                          for(j=n;j>i;j--){
                                   if(card1.kazu[j-1]>card1.kazu[j]){
                                                   tmp=card1.kazu[j-1];
                                                   tmp2=card1.gara[j-1];
                                                   card1.kazu[j-1]=card1.kazu[j];
                                                   card1.gara[j-1]=card1.gara[j];
                                                   card1.kazu[j]=tmp;
                                                   card1.gara[j]=tmp2;
                                                   }
                                   }
                          }
               return 0;
               }

 void select(struct card2.gara[],struct card2.kazu[],int n){
           int i,j,min,tmp,tmp2;
           for(i=0;i<n;i++){
                     min=i;
                     for(j=i;j<n;j++){
                              if(card2.kazu[j]<card2.kazu[min]){
                                                        min=j;
                                                        }
                              }
                     if(min!=i){
                                 tmp=card1.kazu[min];
                                 tmp2=card1.gara[min];
                                 card1.kazu[min]=card1.kazu[i];
                                 card1.gara[min]=card1.gara[i];
                                 card1.kazu[i]=tmp;
                                 card1.gara[i]=tmp2;
                                 }
            return 0;
            }
 
 int main(){
         int i,j,n,x,flag;
         char c;
         scanf("%d",&n);
         for(i=0;i<n;i++){
                    scanf("%c%d",&c,&x);
                    card1.gara[i]=c;
                    card2.gara[i]=card1.gara[i];
                    card1.kazu[i]=x;
                    card2.kazu[i]=card1.kazu[i];
                    }

         bublle(card1,n);
         for(i=0;i<n;i++){
                   printf("%c%d%c",card1.gara[i],card1.kazu[i],(i==n-1)?'\n':' ');
                   }
         printf("Stable\n");
         select(card2,n);
         for(i=0;i<n;i++){
                   printf("%c%d%c",card2.gara[i],card2.kazu[i],(i==n-1)?'\n':' ');
                   }
         flag=1;
         for(i=0;i<n;i++){
                  if(card2.gara[i]!=card1.gara[i]){flag=0;break;}
                  }
         if(flag==1)printf("Stable\n");
         else printf("Not stable\n");

         return 0;
         }








Compiler output:
main.c:11:26: error: expected ';', ',' or ')' before '.' token
   11 |  void bublle(struct card1.gara[],struct card1.kazu[],int n){
      |                          ^
main.c:28:26: error: expected ';', ',' or ')' before '.' token
   28 |  void select(struct card2.gara[],struct card2.kazu[],int n){
      |                          ^
Language: C

#include<stdio.h>
 
 struct card{
           char gara;
           char kazu;
           };

 struct card card1[37];
 struct card card2[37];

 void bublle(struct card card1[],int n){
               int i,j;
               struct card t;
               for(i=0;i<n;i++){
                          for(j=n;j>i;j--){
                                   if(card1[j-1].kazu>card1[j].kazu){
                                                   t=card1[j-1];
                                                   card1[j-1]=card1[j];
                                                   card1[j]=t;
                                                   }
                                   }
                          }
               return 0;
               }

 void select(struct card card2[],int n){
           int i,j,min;
           struct card t;
           for(i=0;i<n;i++){
                     min=i;
                     for(j=i;j<n;j++){
                              if(card2[j].kazu<card2[min].kazu){
                                                        min=j;
                                                        }
                              }
                     if(min!=i){
                              t=card2[j-1];
                              card2[j-1]=card2[j];
                              card2[j]=t;
                                 }
            return 0;
            }
 
 int main(){
         int i,j,n,x,flag;
         char c;
         scanf("%d",&n);
         for(i=0;i<n;i++){
                    scanf("%c%d",&c,&x);
                    card1[i].gara=c;
                    card2[i].gara=card1[i].gara;
                    card1[i].kazu=x;
                    card2[i].kazu=card1[i].kazu;
                    }

         bublle(card1,n);
         for(i=0;i<n;i++){
                   printf("%c%d%c",card1[i].gara,card1[i].kazu,(i==n-1)?'\n':' ');
                   }
         printf("Stable\n");
         select(card2,n);
         for(i=0;i<n;i++){
                   printf("%c%d%c",card2[i].gara,card2[i].kazu,(i==n-1)?'\n':' ');
                   }
         flag=1;
         for(i=0;i<n;i++){
                  if(card2[i].gara!=card1[i].gara){flag=0;break;}
                  }
         if(flag==1)printf("Stable\n");
         else printf("Not stable\n");

         return 0;
         }








Compiler output:
main.c: In function 'bublle':
main.c:23:23: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   23 |                return 0;
      |                       ^
main.c:11:7: note: declared here
   11 |  void bublle(struct card card1[],int n){
      |       ^~~~~~
main.c: In function 'select':
main.c:41:20: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   41 |             return 0;
      |                    ^
main.c:26:7: note: declared here
   26 |  void select(struct card card2[],int n){
      |       ^~~~~~
main.c:73:10: error: expected declaration or statement at end of input
   73 |          }
      |          ^
Language: C

#include <stdio.h>

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

   scanf("%d", &N);

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

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

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

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

            y = C2[j];
            C2[j] = C2[j - 1];
            C2[j - 1] = y;
         }
      }
   }

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

            y = D2[i];
            D2[i] = D2[minj];
            D2[minj] = y;
      }
   }

   g1 = 1;
   g2 = 1;


   for(i = 0; i < N; i++) {
      if (C2 != D2) {
         g2 = 2;
   }

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

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

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

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

   return 0;
}


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

#include <stdio.h>

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

   scanf("%d", &N);

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

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

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

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

            y = C2[j];
            C2[j] = C2[j - 1];
            C2[j - 1] = y;
         }
      }
   }

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

            y = D2[i];
            D2[i] = D2[minj];
            D2[minj] = y;
      }
   }

   g1 = 1;
   g2 = 1;


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

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

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

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

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

   return 0;
}


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

#include <stdio.h>

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

   scanf("%d", &N);

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

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

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

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

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

   g1 = 1;
   g2 = 1;


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

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

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

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

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

   return 0;
}


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