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

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

void printVec(vector<int> v, int n)
{
    for (int i = 0; i < n; i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
}

void selection_Sort(vector<int> v, int n){
    int mini, count = 0;
    for (int i = 0; i < n - 1; i++)
    {
        mini = i;
        for (int j = i + 1; j < n; j++)
        {
            if (v[j] < v[mini])
                mini = j;
        }

        if (i != mini)
        {
            count++;
            swap(v[i], v[mini]);
        }
    }

    printVec(v,n);
    cout << endl
         << count << endl;
}

int main()
{
    
    cin >> n;
    vector<int> v;
    int temp;
    for (; cin >> temp;)
    {
        v.push_back(temp);
    }

    

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   61 |     cin >> n;
      |            ^
      |            yn
Language: C++

#include "stdafx.h"
/***選択ソート***/
#include <stdio.h>
int selectionSort(int A[],int N) {
	int counter = 0;
	for (int i = 0;i < N;i++) {
		int minj = i;
		for (int j = i;j < N;j++) {
			if (A[j] < A[minj])
				minj = j;
		}
		if (!(i == minj)) {
			int dumy = A[i];
			A[i] = A[minj];
			A[minj] = dumy;
			counter++;
		}
	}
	for (int i = 0;i < N;i++) {
		if (i > 0) printf(" ");
		printf("%d", A[i]);
	}
	printf("\n");

	return counter;
}
int main() {
	int N,i;
	int A[100];
	scanf("%d", &N);
	for (i = 0;i < N;i++)
		scanf("%d", &A[i]);
	printf("%d\n", selectionSort(A, N));
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>

int selectionSort(int *A, int N) {
    int count=0;
    for (int i=0; i<N; i++) {
        int minj = i;
        for (int j=i; j<N-1; j++) {
            if (A[j] < A[minj]) {
                minj = j;
                count++;
            }
        }
        int tmp = A[i];
        A[i] = A[minj];
        A[minj] = tmp; 
    }
    
    return count;
}

void outputArray(int *A, int N) {
    printf("%d", A[0]);
    for (int i=1; i<N; i++) {
        printf(" %d", A[i]);
    }
    printf("\n");
}

int main() {
    int n;
    scanf("%d", &n);
    
    int a[n];
    for (int i=0; i<n; i++) scanf("%d", &a[i]);
    
    int count = selectionSort(a, n);
    outpurArray(a, n);
    printf("%d\n", count);
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'outpurArray' was not declared in this scope; did you mean 'outputArray'?
   37 |     outpurArray(a, n);
      |     ^~~~~~~~~~~
      |     outputArray
Language: C++

#include <stdio.h>

int selectionSort(int *A, int N) {
    int count=0;
    
    for (int i=0; i<N; i++) {
        minj = i;
        for (int j=i; j<N; j++) {
            if (A[j] < A[minj]) {
                minj = j;
            }
        }
        int tmp = A[i];
        A[i] = A[minj];
        A[minj] = tmp;
        count++;
    }
}

void outputArray(int *A, int N) {
    printf("%d", A[0]);
    for (int i=1; i<N; i++) printf(" %d", A[i]);
    printf("\n");
}

int main() {
    int n;
    scanf("%d", &n);
    
    int a[n];
    for (int i=0; i<n; i++) scanf("%d", &a[i]);
    
    int count = selectionSort(a, n);
    outputArray(a, n);
    printf("%d\n", count);
    
    return 0;
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:7:9: error: 'minj' was not declared in this scope
    7 |         minj = i;
      |         ^~~~
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include<stdio.h>

int main(){
  int A[100], n, i, j, t, sw = 0, mini;

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

  for ( i = 0; i < n; i++ ){
    mini = i;
    for ( j = i; j < n; j++ ){
      if ( A[j] < A[mini] ) mini = j;
    }
    t = A[i]; A[i] = A[mini]; A[mini] = t;
    if ( i != mini ) sw++;
  }

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

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: 'sws' was not declared in this scope; did you mean 'sw'?
   23 |   printf("%d\n", sws);
      |                  ^~~
      |                  sw
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int a[100]={0},i,j,kaisu=0,num,mini;

  cin >>num;
  for(i=0;i<num;i++){
    cin >>a[i];
  }



  for(i=0 ; i<num-1;i++){
    mini=i;
    for(j=i+1;j<num;j++){//num-1
      
      if(a[j]<a[mini]){ mini=j;
      }
    
    

    }
    if(mini!=i){
    swap(a[i],a[mini]);
    kaisu++;
    }

  }
  





      for(i=0;i<num;i++){
	cout <<a[i];
	if(i<num-1){cout <<" ";
	}
      }


      cout<<endl;
      cout<<kaisu<<endl;
      
  


Compiler output:
a.cc: In function 'int main()':
a.cc:46:25: error: expected '}' at end of input
   46 |       cout<<kaisu<<endl;
      |                         ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
void solve(int a[],int num)
{
    int mini=0，tmp=0;
    for(int i=0;i<num;i++)
        {
            mini = i;
        for(int j=i;j<num;j++)
            if(a[j]<a[mini])
            {
                mini=j;
                swap(a[i],a[mini]);
                tmp++;
            }
        }
    for(int i=0;i<num;i++)
    if(i==num-1)     cout<<a[i]<<endl;
    else  cout<<a[i]<<" ";
    cout<<tmp<<endl;
}
int main()
{
    int num;
    cin>>num;
    int a[num];
    int mini=0，tmp=0;
    for(int i=0;i<num;i++)
        cin>>a[i];
   
    return 0;
}


Compiler output:
a.cc: In function 'void solve(int*, int)':
a.cc:5:14: error: unable to find numeric literal operator 'operator""\U0000ff0ctmp'
    5 |     int mini=0，tmp=0;
      |              ^~~~~~
a.cc:14:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   14 |                 tmp++;
      |                 ^~~
      |                 tm
a.cc:20:11: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   20 |     cout<<tmp<<endl;
      |           ^~~
      |           tm
a.cc: In function 'int main()':
a.cc:27:14: error: unable to find numeric literal operator 'operator""\U0000ff0ctmp'
   27 |     int mini=0，tmp=0;
      |              ^~~~~~
Language: C++

#include<stdio.h>
int main(){
  int N=0,i=0,j=0,count=0;
  int A[10000];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  count=selsort(A,N);
  if(N>1){
    for(i=0;i<N;i++){
      if(i<N-1){
	printf("%d ",A[i]);
      }
      if(i==N-1){
	printf("%d",A[i]);
      }
    }
    printf("\n");
    printf("%d\n",count);
  }
  else {
    for(i=0;i<N;i++){
      printf("%d",A[i]);
    }
    printf("\n");
    printf("%d\n",count);
  }
  return 0;
}
int selsort(int A[], int N){
  int i=0,j=0,temp=0;
  int min=0;
  int count=0;
  for(i=0;i<=N-1;i++){
    min=i;
    for(j=i;j<=N-1;j++){
      if(A[j]<A[min]){
	min=j;
      }
    }
    temp=A[i];
    A[i]=A[min];
    A[min]=temp;
    if(i!=min)count++;
  }
  return count;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'selsort' was not declared in this scope; did you mean 'short'?
    9 |   count=selsort(A,N);
      |         ^~~~~~~
      |         short
Language: C++

import java.util.Scanner;

public class Main {
	
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int minj = 0;
		int A[] = new int[N];
		int count = 0;
		int tmp = 0;
		
		for(int i=0; i<N; i++){
			A[i] = sc.nextInt();
		}
		
		for(int i=0; i<N; i++){
			minj = i;
			for(int j=i; j<N; j++){
				if(A[j] < A[minj]){
					minj = j;
				}
			}
			if(A[i]!=A[minj]){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				count++;
			}
		}
		for(int i=0; i<N; i++){
			System.out.print(A[i] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
	}
}



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception{
	int i=0,j=0;
	int tmp;
	int[] A;
	int Count_Sort = 0;
	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String N_str = br.readLine();
	String A_str = br.readLine();


	int N = Integer.parseInt(N_str);
	Scanner sc = new Scanner(A_str).useDelimiter("//s* //s*");
	
	A = new int[N];

	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

	for(i=0;i<N-1;i++){
	    int minj = i;
	    for(j=i;j<N-1;j++){
		if(A[j]<A[minj]){
		    minj = j;
		    Count_Sort++;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	}
	    

	for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N) System.out.print(" ");
	}
	System.out.println("");
	System.out.println(Count_Sort);
    }
}



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:11: error: expected ':' before 'static'
    5 |     public static void main(String[] args) throws Exception{
      |           ^~~~~~~
      |           :
a.cc:5:29: error: 'String' has not been declared
    5 |     public static void main(String[] args) throws Exception{
      |                             ^~~~~~
a.cc:5:38: error: expected ',' or '...' before 'args'
    5 |     public static void main(String[] args) throws Exception{
      |                                      ^~~~
a.cc:5:42: error: expected ';' at end of member declaration
    5 |     public static void main(String[] args) throws Exception{
      |                                          ^
      |                                           ;
a.cc:5:44: error: 'throws' does not name a type
    5 |     public static void main(String[] args) throws Exception{
      |                                            ^~~~~~
a.cc:48:2: error: expected ';' after class definition
   48 | }
      |  ^
      |  ;
Language: C++

#include<iostream>
using namespace std;
int selectionSort(int p[],int n){
    int sw=0;
    int min=0;
    for(int i=0;i<n-1;++i){
        min=i;
        for(int j=i+1;j<n;++j){
            if(p[j]<p[min])
               min=j;
        }
        if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++}
    }
    return 0;
}
int main(){
    int n;
    cin>>n;
    int *p=new int[n];
    for(int i=0;i<n;++i)cin>>n;
    
    int m=selectionSort(p,n);
    
    for(int i=0;i<n-1;++i)cout<<p[i]<<' ';
    cout<<p[n-1]<<endl;
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:12:56: error: expected ';' before '}' token
   12 |         if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++}
      |                                                        ^
      |                                                        ;
Language: C++

#include<iostream>
using namespace std;
int selectionSort(int p[],int n){
    int sw=0;
    int min=0;
    for(int i=0;i<n-1;++i){
        min=i;
        for(int j=i+1;j<n;++j){
            if(p[j]<p[min])
               min=j;
        }
        if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++}
    }
    return sw;
}
int main(){
    int n;
    cin>>n;
    int *p=new int[n];
    for(int i=0;i<n;++i)cin>>n;
    
    int m=selectionSort(p,n);
    
    for(int i=0;i<n-1;++i)cout<<p[i]<<' ';
    cout<<p[n-1]<<endl;
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:12:56: error: expected ';' before '}' token
   12 |         if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++}
      |                                                        ^
      |                                                        ;
Language: C++

#include<iostream>
using namespace std;
int selectionSort(int p[],int n){
    int sw=0;
    int min=0;
    for(int i=0;i<n-1;++i){
        min=i;
        for(int j=i+1;j<n;++j){
            if(p[j]<p[min])
               min=j;
        }
        if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++}
    }
    return sw;
}
int main(){
    int n;
    cin>>n;
    int *p=new int[n];
    for(int i=0;i<n;++i)cin>>p[i];
    
    int m=selectionSort(p,n);
    
    for(int i=0;i<n-1;++i)cout<<p[i]<<' ';
    cout<<p[n-1]<<endl;
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:12:56: error: expected ';' before '}' token
   12 |         if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++}
      |                                                        ^
      |                                                        ;
Language: C++

#include<iostream>
using namespace std;
int selectionSort(int p[],int n){
    int sw=0;
    int min=0;
    for(int i=0;i<n-1;++i){
        min=i;
        for(int j=i+1;j<n;++j){
            if(p[j]<p[min])
               min=j;
        }
        if(min!=i){int t=p[i];p[i]=p[min];p[min]=t;sw++;}
    }
    return sw;
}
int main(){
    int n;
    cin>>n;
    int *p=new int[n];
    for(int i=0;i<n;++i)cin>>p[i];
    
    int m=selectionSort(p,n);
    
    for(int i=0;i<n-1;++i)cout<<p[i]<<' ';
    cout<<p[n-1]<<endl;
    cout<<sw<<endl;
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: 'sw' was not declared in this scope
   26 |     cout<<sw<<endl;
      |           ^~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        int total;

        Scanner inp = new Scanner(System.in);
        total = inp.nextInt();

        String[] b = new String[total];
        String[] c = new String[total];

        for (int k = 0; k < total; k++) {
            String a = inp.next();

            b[k] = a;
            c[k] = a;
        }

        for (int i = 0; i < total; i++) {
            for (int j = total - 1; j > i; j--) {
                if (b[j].charAt(1) < b[j - 1].charAt(1)) {
                    String temp = b[j];
                    b[j] = b[j - 1];
                    b[j - 1] = temp;
                }
            }
        }

        for (int l = 0; l < total; l++) {
            if (l == 0) {
                System.out.printf("%s", b[l]);
            } else {
                System.out.printf(" %s", b[l]);
            }
        }

        System.out.println("\n" + "Stable");


        for (int i = 0; i < total; i++) {
            int mini = i;
            for (int j = i + 1; j < total; j++) {
                if (c[j].charAt(1) < c[mini].charAt(1)) {
                    mini = j;
                }
            }

            if (i != mini) {
                String temp = c[i];
                c[i] = c[mini];
                c[mini] = temp;
            }
        }


        for (int l = 0; l < total; l++) {
            if (l == 0) {
                System.out.printf("%s", c[l]);
            } else {
                System.out.printf(" %s", c[l]);
            }
        }

        int counter = 0;

        for (int l = 0; l < total; l++) {
            if (b[l] == c[l]) {
                {
                    counter++;
                }
            }
        }

        if (counter == total) {
            System.out.print("\n" + "Stable");
        } else {
            System.out.print("\n" + "Not stable");
        }
    }

System.out.println("\n");
}



Compiler output:
Main.java:82: error: <identifier> expected
System.out.println("\n");
                  ^
Main.java:82: error: illegal start of type
System.out.println("\n");
                   ^
2 errors
Language: Java

import java.util.*;

public class StableSort {

    static class Card{
        final String key;
        final int value;

        Card(String k, int v){
            key = k;
            value = v;
        }
        @Override
        public String toString() {
            return key + value;
        }
    }

    private static Card[] bubbleSort(Card[] C){
        int n = C.length;

        for (int i = 0; i < n; i++) {
            for (int j = n-1; j > i ; j--)
                if(C[j].value < C[j-1].value){
                    // swap
                    Card temp = C[j];
                    C[j] = C[j-1];
                    C[j-1] = temp;
                }
        }
        return C;
    }

    private static Card[] selectionSort(Card[] C){
        int n = C.length;

        for (int i = 0; i < n; i++) {
            int mini = i;
            for (int j = i; j < n; j++)
                if (C[j].value < C[mini].value)
                    mini = j;
            // swap
            if(mini != i) {
                Card temp = C[i];
                C[i] = C[mini];
                C[mini] = temp;
            }
        }
        return C;
    }


    private static boolean isStabele(Card[] a, Card[] b){
        int n = a.length;
        for (int i = 0; i < n; i++) {
            if (a[i].key != b[i].key)
                return false;
        }
        return true;
    }


    // print the list of cards
    private static void print(Card[] cards){
        int n = cards.length;
        for (int i = 0; i < n - 1; i++)
            System.out.print(cards[i].toString() + " ");
        System.out.print(cards[n-1].toString());
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Card[] cards = new Card[n];

        for (int i = 0; i < n; i++) {
            String s = sc.next();
            cards[i] = new Card(s.substring(0,1),Integer.parseInt(s.substring(1)));
        }


        Card[] bubble = bubbleSort(cards);
        Card[] selection = selectionSort(cards);
        print(bubble);
        System.out.println("\nStable");
        print(selection);
        if (isStabele(bubble,selection)) System.out.println("\nStable");
        else System.out.println("\nNot stable");

    }
}



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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Card[] c1 = new Card[N];
		for (int i = 0; i < N; i++) {
			c1[i] = new Card();
		}
		for (int i = 0; i < N; i++) {
			String strC = sc.next();
			char[] chrC = strC.toCharArray();
			c1[i].setSuit(chrC[0]);
			c1[i].setValue(chrC[1]);
		}
		Card[] c2 = c1.clone();
		bubbleSort(c1, N);
		selectionSort(c2, N);
		print(c1, N);
		System.out.println("Stable");
		print(c2, N);
		if (isStable(c1, c2, N)) {
			System.out.println("Stable");
		} else {
			System.out.println("Not stable");
		}
		sc.close();
	}

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

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

	public static void print(Card A[], int N) {
		for (int i = 0; i < N; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(A[i].getSuit() + "" + A[i].getValue());
		}
		System.out.printf("\n");
	}

	public static boolean isStable(Card[] c1, Card[] c2, int N) {
		for (int i = 0; i < N; i++) {
			if (c1[i].getSuit() != c2[i].getSuit()) {
				return false;
			}
		}
		return true;
	}
}

class Card implements Cloneable {

	private char suit;
	private char value;

	@Override
	public Card clone() {
		Card card = new Card();
		try {
			card = (Card) super.clone();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return card;
	}

	public char getSuit() {
		return suit;
	}

	public void setSuit(char suit) {
		this.suit = suit;
	}

	public char getValue() {
		return value;
	}

	public void setValue(char value) {
		this.value = value;
	}
}



Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Card[] c1 = new Card[N];
		for (int i = 0; i < N; i++) {
			c1[i] = new Card();
		}
		for (int i = 0; i < N; i++) {
			String strC = sc.next();
			char[] chrC = strC.toCharArray();
			c1[i].setSuit(chrC[0]);
			c1[i].setValue(chrC[1]);
		}
		Card[] c2 = c1.clone();
		bubbleSort(c1, N);
		selectionSort(c2, N);
		print(c1, N);
		System.out.println("Stable");
		print(c2, N);
		if (isStable(c1, c2, N)) {
			System.out.println("Stable");
		} else {
			System.out.println("Not stable");
		}
		sc.close();
	}

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

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

	public static void print(Card A[], int N) {
		for (int i = 0; i < N; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(A[i].getSuit() + "" + A[i].getValue());
		}
		System.out.printf("\n");
	}

	public static boolean isStable(Card[] c1, Card[] c2, int N) {
		for (int i = 0; i < N; i++) {
			if (c1[i].getSuit() != c2[i].getSuit()) {
				return false;
			}
		}
		return true;
	}
}

class Card implements Cloneable {

	private char suit;
	private char value;

	public Card clone() {
		Card card = new Card();
		try {
			card = (Card) super.clone();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return card;
	}

	public char getSuit() {
		return suit;
	}

	public void setSuit(char suit) {
		this.suit = suit;
	}

	public char getValue() {
		return value;
	}

	public void setValue(char value) {
		this.value = value;
	}
}



Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.StringTokenizer;

public class Test {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		String[] bubble = new String[n];
		String[] select = new String[n];
		String[] confirm=new String[n];
		for (int i = 0; i < n; i++) {
			String str = st.nextToken();
			bubble[i] = str;
			select[i] = str;
			
			
		}
		boolean con=true;
		bubblesort(bubble);
		selectsort(select);
		StringBuilder stb1 = new StringBuilder(bubble[0]);
		StringBuilder stb2 = new StringBuilder(select[0]);
		boolean con1=sortconfirm(confirm, bubble);
		boolean con2=sortconfirm(confirm,select);
		
		System.out.println(stb1+"\r\n"+(con?"Stable":"Not stable"));			
		System.out.println(stb2+"\r\n"+(con?"Stable":"Not stable"));

	}

	static void bubblesort(String[] in) {
		for (int i = in.length; i > 0; i--) {
			for (int j = 1; j < i; j++) {

				if (in[j - 1].charAt(1) > in[j].charAt(1)) {
					
					String tmp = in[j - 1];
					in[j - 1] = in[j];
					in[j] = tmp;
				}
			}
		}
		
	}

	static void selectsort(String[] in) {
		
		for(int i=0;i<in.length-1;i++){
			int mini=i;
			for(int j=i+1;j<in.length;j++){
				if(in[mini].charAt(1)>in[j].charAt(1)){
					mini=j;
				}
			}
			if(mini!=i){
			String tmp=in[i];
			in[i]=in[mini];
			in[mini]=tmp;}
		}}
	static boolean sortconfirm(String[] input,String[] sorted){
		StringBuilder[] comp1=new StringBuilder[9];
		StringBuilder[] comp2=new StringBuilder[9];
		for(int i=0;i<input.length;i++){
			char s=input[i].charAt(1);
			comp1[Integer.parseInt(Character.toString(s))-1].append(input[i].charAt(0));
			char t=sorted[i].charAt(1);
			comp1[Integer.parseInt(Character.toString(t))-1].append(sorted[i].charAt(0));
		}
		boolean con=true;
		for(int i=0;i<9;i++){
			if(comp1[i].toString().equals(comp2[i].toString()))continue;
			else con=false;break;
		}
		return con;
	}
}

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

import java.io.*;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		String[] bubble = new String[n];
		String[] select = new String[n];
		String[] confirm=new String[n];
		for (int i = 0; i < n; i++) {
			String str = st.nextToken();
			bubble[i] = str;
			select[i] = str;
			
			
		}
		boolean con=true;
		bubblesort(bubble);
		selectsort(select);
		StringBuilder stb1 = new StringBuilder(bubble[0]);
		StringBuilder stb2 = new StringBuilder(select[0]);
		boolean con1=sortconfirm(confirm, bubble);
		boolean con2=sortconfirm(confirm,select);
		
		System.out.println(stb1+"\r\n"+(con?"Stable":"Not stable"));			
		System.out.println(stb2+"\r\n"+(con?"Stable":"Not stable"));

	}

	static void bubblesort(String[] in) {
		for (int i = in.length; i > 0; i--) {
			for (int j = 1; j < i; j++) {

				if (in[j - 1].charAt(1) > in[j].charAt(1)) {
					
					String tmp = in[j - 1];
					in[j - 1] = in[j];
					in[j] = tmp;
				}
			}
		}
		
	}

	static void selectsort(String[] in) {
		
		for(int i=0;i<in.length-1;i++){
			int mini=i;
			for(int j=i+1;j<in.length;j++){
				if(in[mini].charAt(1)>in[j].charAt(1)){
					mini=j;
				}
			}
			if(mini!=i){
			String tmp=in[i];
			in[i]=in[mini];
			in[mini]=tmp;}
		}}
	static boolean sortconfirm(String[] input,String[] sorted){
		StringBuilder[] comp1=new StringBuilder[9];
		StringBuilder[] comp2=new StringBuilder[9];
for(int i=0;i<9;i++){
			comp1[i]=new StringBuilder();
			comp2[i]=new StringBuilder();
		for(int i=0;i<input.length;i++){
			char s=input[i].charAt(1);
			comp1[Integer.parseInt(Character.toString(s))-1].append(input[i].charAt(0));
			char t=sorted[i].charAt(1);
			comp1[Integer.parseInt(Character.toString(t))-1].append(sorted[i].charAt(0));
		}
		boolean con=true;
		for(int i=0;i<9;i++){
			if(comp1[i].toString().equals(comp2[i].toString()))continue;
			else con=false;break;
		}
		return con;
	}
}

Compiler output:
Main.java:83: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        String[] inputs = input();
        String[] inputs = mockup();

        String[] inputs4S = inputs.clone();

        int swapCount = bubbleSort(inputs);
        output(inputs);
        System.out.println("stable");

        int swapCount4S = selectionSort(inputs4S);
        output(inputs4S);
        System.out.println("unstable");
    }

    /** bubble sort
     *
     * @param inputs
     * @return
     */
    private static int bubbleSort(String inputs[]) {
        int swapCount = 0;
        for (int i = 0; i < inputs.length; i++) {
            for (int j = inputs.length - 1; j > i; j--) {
                if (compare(inputs[j], inputs[j-1])) {
                    swap(inputs, j, j-1);
                    swapCount++;
                }
            }
        }
        return swapCount;
    }

    /**
     * selection sort
     * @param inputs
     * @return
     */
    private static int selectionSort(String[] inputs) {
        int swapCount = 0;
        int min = 0;

        for (int i = 0; i < inputs.length; i++) {
            min = i;
            for (int j = i; j < inputs.length; j++) {
                if (compare(inputs[j], inputs[min])) {
                    min = j;
                }
            }
            if (i != min) {
                swap(inputs, i, min);
                swapCount++;
            }
        }
        return swapCount;
    }

    private static String[] mockup() {
        String a[] = {"H4","C9","S4","D2","C3"};
        return a;
    }

    private static void swap(String[] inputs, int j, int i) {
        String a = inputs[j];
        String b = inputs[i];
        inputs[i] = a;
        inputs[j] = b;
    }
    private static boolean compare(String a, String b) {
        int iA = Integer.valueOf(a.substring(1));
        int iB = Integer.valueOf(b.substring(1));
        return iA < iB;
    }

    public static void output(String[] inputs) {
        // output
        StringBuilder output = new StringBuilder();
        for (String i : inputs) {
            output.append(i + " ");
        }
        String outputString = output.toString();
        System.out.println(outputString.substring(0,outputString.length() - 1));
    }

    public static String[] input() {
        Scanner in = new Scanner(System.in);
        int count = in.nextInt();
        String[] inputs = new String[count];
        for (int i = 0; i < count; i++) {
            inputs[i] = in.next();
        }
        in.close();
        return inputs;
    }

}

Compiler output:
Main.java:8: error: variable inputs is already defined in method main(String[])
        String[] inputs = mockup();
                 ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ALDS1_2_C {

	public static void main(String[] args) throws Exception {
		BufferedReader breader = getReader();
		int n = getInt(breader); 
		String[] num = getAry(breader);
		int c = cardComp(num[0],num[1]);
		boolean stable = true;
		//duplicate ary
		String[] numbk = new String[n];
		for( int i = 0 ; i < n ; i++ ) {
			numbk[i] = num[i];
		}
		//initialize number array
		int[] nary = new int[n];
		for( int i = 0 ; i < n ; i++ ) {
			nary[i] = i;
		}
		//Bubble sort
		for( int i = 0 ; i < n ; i++ ) {
			for( int j = n-1 ; j > 0 ; j-- ) {
				if ( cardComp(num[j-1], num[j])> 0) {
					String wk = num[j-1];
					num[j-1] = num[j];
					num[j] = wk;
					int nwk = nary[j-1];
					nary[j-1] = nary[j];
					nary[j] = nwk;
				}
			}
		}
		stable = true;
		for( int i = 0 ; i < n-1 ; i++ ) {
			if ( cardComp(num[i], num[i+1]) == 0) {
				if ( nary[i] > nary[i+1] ) {
					stable = false;
					break;
				}
			}
		}
		putAry(num);
		if ( stable == true ) {
			System.out.println( "Stable");
		} else {
			System.out.println("Not stable");
		}
		//Selection sort
		//restore ary
		for( int i = 0 ; i < n ; i++ ) {
			num[i] = numbk[i];
			nary[i] = i;
		}
		for( int i = 0 ; i < n ; i++ ) {
			int mini = i;
			for( int j = i+1 ; j < n ; j++ ) {
				if ( cardComp(num[mini], num[j])> 0) {
					mini = j;
				}
			}
			String wk = num[i];
			num[i] = num[mini];
			num[mini] = wk;
			int nwk = nary[i];
			nary[i] = nary[mini];
			nary[mini] = nwk;
		}
		stable = true;
		for( int i = 0 ; i < n-1 ; i++ ) {
			if ( cardComp(num[i], num[i+1]) == 0) {
				if ( nary[i] > nary[i+1] ) {
					stable = false;
					break;
				}
			}
		}
		putAry(num);
		if ( stable == true ) {
			System.out.println( "Stable");
		} else {
			System.out.println("Not stable");
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	}
	public static String[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		return nstr;
	}
	public static int cardComp(String left, String right) {
		char l = left.charAt(1);
		char r = right.charAt(1);
		return(l-r);
	}
	public static int[] getAryMl(BufferedReader br)throws Exception {
		int n = getInt(br);
		int[] ary = new int[n];
		for( int i=0 ; i < n ; i++ ) {
			ary[i] = getInt(br);
		}
		return ary;
	}
	public static void putAry(Object[] ary, int num) {
		for( int i = 0; i < num ; i++ ) {
			System.out.print(ary[i]);
			if ( i < num-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	}
	public static void putAry(Object[] ary) {
		putAry(ary, ary.length ) ;
	}
	public static boolean isPrime(int n) {
		int r = (int)Math.sqrt((double)n)+1;
		for( int j = 2 ; j < r ; j += 1) {
			if ( n%j == 0 ) {
				return false;
			}
		}
		return true;
	}

	

}

Compiler output:
Main.java:4: error: class ALDS1_2_C is public, should be declared in a file named ALDS1_2_C.java
public class ALDS1_2_C {
       ^
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) {
    }
  }
}

public 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; i<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; j<cnt; j++) {
        if(in[i] == in[j]) {
          for(int k=0; k<cnt; k++) {
            for(int l=k; l<cnt; l++) {
              if(Sort.compCard(out[k], in[j])==0 && Sort.compCard(out[l], in[i])==0) {
                return false;
              }
            }
          }
        }
      }
    }
    return true;  
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.io.*
                ^
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) {
    }
  }
}

public 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; i<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; j<cnt; j++) {
        if(in[i] == in[j]) {
          for(int k=0; k<cnt; k++) {
            for(int l=k; l<cnt; l++) {
              if(Sort.compCard(out[k], in[j])==0 && Sort.compCard(out[l], in[i])==0) {
                return false;
              }
            }
          }
        }
      }
    }
    return true;  
  }
}

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

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

public class Main{
	public static void main(String[] args)throws NumberFormatException,IOException{
		int n,i,j,minj;
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String buf = br.readLine();
		n = Integer.parseInt(buf);
			

		String[] arr = new String[n]; /*arr???????????????????????¨*/
		String[] arr1 = new String[n]; /*arr1????????¬????????§??????????????¨*/

		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader ar = new BufferedReader(is);

		String str = ar.readLine(); /*str????????????????????????????????????????????¨*/
		arr = str.split(" "); 
		arr1 = str.split(" ");
	
		
		/*??????????????????*/
		for(i=0;i<n;i++){
			boolean bln = true;
			while(bln){
				bln = false;
			for(j=n-1;1<=j;j--){
				if(arr[j].charAt(1)<arr[j-1].charAt(1)){
					String temp = arr[j-1];
					arr[j-1] = arr[j];
					arr[j] = temp;
					bln = true;
				}
			}
			}
		}

		/*??¨???*/
		for(i=0;i<n;i++){
			System.out.print(arr[i]+" ");
		}
			System.out.println("\nStable");


			/*?????¬????????§????????????*/
			for(i=0;i<n-1;i++){
				  minj = i;
				for(j=i;j<n;j++){
					if(arr1[j].charAt(1)<arr1[minj].charAt(1)){
						minj = j;
					}
				}
					String temp1 = arr1[i];
					arr1[i] = arr1[minj];
					arr1[minj] = temp1;
						
			}
				
		
			/*??¨???*/
			for(i=0;i<n;i++){
				System.out.print(arr1[i]+" ");
			}
				System.out.println();

				boolean bln1 = true;
			/*??????*/
			for(i=0;i<n;i++){
				if(!arr[i].equals(arr1[i])) bln = false;
			}

			if(bln)System.out.println("Stable");
			else System.out.println("Not stable");
}
}

Compiler output:
Main.java:73: error: cannot find symbol
				if(!arr[i].equals(arr1[i])) bln = false;
				                            ^
  symbol:   variable bln
  location: class Main
Main.java:76: error: cannot find symbol
			if(bln)System.out.println("Stable");
			   ^
  symbol:   variable bln
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class alds12c {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt();
		
		String s;
		char[] ch;
		
		char[][] C = new char[2][n];
		char[][] C2 = new char[2][n];
		
		for(int i = 0; i < n; i++){
			s = scan.next();
			ch = s.toCharArray();
			C[0][i] = ch[0];
			C[1][i] = ch[1];
			C2[0][i] = C[0][i];
			C2[1][i] = C[1][i];
		}
		
		//??????????????????
		char swap;
		for(int i = 0; i <= n - 1; i++){
			for(int j = n-1; j >= i + 1; j--){
				if(C[1][j] < C[1][j-1]){
					swap = C[1][j];
					C[1][j] = C[1][j-1];
					C[1][j-1] = swap;
					swap = C[0][j];
					C[0][j] = C[0][j-1];
					C[0][j-1] = swap;
				}
			}
		}
		
		//???????????????
		int minj;
		for(int i = 0; i <= n - 1; i++){
			minj = i;
			for(int j = i; j <= n - 1; j++){
				if(C2[1][j] < C2[1][minj]){
					minj = j;
				}
			}
			swap = C2[1][i];
			C2[1][i] = C2[1][minj];
			C2[1][minj] = swap;
			swap = C2[0][i];
			C2[0][i] = C2[0][minj];
			C2[0][minj] = swap;
		}
		
		for(int i = 0; i < n; i++){
			System.out.print(C[0][i]);
			System.out.print(C[1][i]);
			if(i < n - 1)System.out.print(" ");
			else System.out.println();
		}
		System.out.println("Stable");
		
		boolean flag = true;
		
		for(int i = 0; i < n; i++){
			System.out.print(C2[0][i]);
			System.out.print(C2[1][i]);
			if(C[0][i] != C2[0][i] || C[1][i] != C2[1][i])flag = false;
			if(i < n - 1)System.out.print(" ");
			else System.out.println();
		}
		if(flag == true) System.out.println("Stable");
		else System.out.println("Not Stable");
	}
}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static int N;

	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 = card[j].substring(1);
				String sjj = cards[j-1].substring(1);
				int vj = Interger.parseInt(sj);
				int vjj = Integer.parseInt(sjj);
				if(vj < vjj){
					String work = cards[j];
					cards[j] = cards[j-1];
					card[j-1] = work;
				}
			}
		}

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

		// ???????????????
		for(int i = 0; i < N; i++){
			int minj = i;
			for(int j = i; i < 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;
				}
			}
			if(i != minj){
				String work = copys[minj];
				copys[minj] = copys[i];
				copys[i] = work;
			}
		}

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

	public static boolean isStable(String[] in, String[] out){
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
				for(int a = 0; a < N; a++){
					for(int b = a+1; b < N; b++){
						String si = in[i].substring(1);
						String sj = in[j].substring(1);
						int vi = Integer.parseInt(si);
						int vj = Integer.parseInt(sj);
						if(vi == vj && in[i].equals(out[b]) && in[j].equals(out[a])){
							return false;
						}
					}
				}
			}
		}
		return true;
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
				String sj = card[j].substring(1);
				            ^
  symbol:   variable card
  location: class Main
Main.java:24: error: cannot find symbol
				int vj = Interger.parseInt(sj);
				         ^
  symbol:   variable Interger
  location: class Main
Main.java:29: error: cannot find symbol
					card[j-1] = work;
					^
  symbol:   variable card
  location: class Main
3 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static int N;

	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 = Interger.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? "%d " : "%d\n", cards[i]);
		}
		System.out.printf("%s\n", isStable(ins, cards)? "Stable" : "Not stable");

		// ???????????????
		for(int i = 0; i < N; i++){
			int minj = i;
			for(int j = i; i < 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;
				}
			}
			if(i != minj){
				String work = copys[minj];
				copys[minj] = copys[i];
				copys[i] = work;
			}
		}

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

	public static boolean isStable(String[] in, String[] out){
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
				for(int a = 0; a < N; a++){
					for(int b = a+1; b < N; b++){
						String si = in[i].substring(1);
						String sj = in[j].substring(1);
						int vi = Integer.parseInt(si);
						int vj = Integer.parseInt(sj);
						if(vi == vj && in[i].equals(out[b]) && in[j].equals(out[a])){
							return false;
						}
					}
				}
			}
		}
		return true;
	}
}

Compiler output:
Main.java:24: error: cannot find symbol
				int vj = Interger.parseInt(sj);
				         ^
  symbol:   variable Interger
  location: class Main
1 error