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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		int[] inputData = new int[n];
		for (int i = 0; i < n; i++) {
			inputData[i] = Integer.parseInt(strs[i]);
		}
		printArray(inputData, bubbleSort(inputData, n));
	}

	public static int bubbleSort(int[] A, int N) {
		int swapCnt = 0;
		int flag = 1;
		while (flag == 1) {
			flag = 0;
			for (int i = N - 1; i > 0; i--) {
				if (A[i] < A[i - 1] ) {
					int temp = A[i];
					A[i] = A[i - 1];
					A[i - 1] = temp;
					swapCnt++;
					flag = 1;
				}
			}
		}
		return swapCnt;
	}

	public static void printArray(int[] target, int swapCnt) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < target.length; i++) {
			sb.append(target[i]);
			if (i < target.length - 1) {
				sb.append(" ");
			}
		}
		sb.append("\n");
		sb.append(swapCnt);
		System.out.println(sb.toString());
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: Java

import java.util.Scanner;

public class BubbleSort {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();

		String[] datastr = sc.nextLine().split(" ");
		int[] a = new int[n];
		for (int i=0; i < n; i++) {
			a[i] = Integer.parseInt(datastr[i]);
		}

		int count = 0;

		for (int i=0; i < n; i++) {
			for (int j = n-1; i+1 <= j; j--) {

				if (a[j-1] > a[j]) {
					int temp = a[j];
					a[j] = a[j-1];
					a[j-1] = temp;
					count++;
				}

			}
		}

		for (int i=0; i < n-1; i++) {
			System.out.print(a[i] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(count);

	}

}

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

import java.util.Scanner;

public class Sort{
	
public static int bubbleSort(int A[],int N){
    int i,j,r=0,temp;
    boolean flag=true;
    for(i=0;flag;i++){
    	flag=false;
        for(j=N-1;j>=i+1;j--){
        	if(A[j]<A[j-1]){
        		temp=A[j];
        		A[j]=A[j-1];
        		A[j-1]=temp;
        flag=true;
        r++;      	
        }
}
}
    return r;
}
   
public static void main(String[] args){
         
		 Scanner sc= new Scanner(System.in);
	         int N=sc.nextInt();
             int A[]=new int[100];
             
             int i,j;
             for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             }
	       
        int loop = bubbleSort(A,N);
        for(j=0;j<N;j++){
        System.out.print(A[j]+" ");
        }
        System.out.println();
        System.out.println(loop);
        sc.close();
}
}

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

import java.util.*;

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

	public static void main(String[] args){
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++){
			arr[i] = scan.nextInt();
		}
		int count = 0;
		boolean flag = 1;
		int i = 0;
		while(flag){
			flag = 0;
			for(int j = n-1; j <= i+1; j--){
				if(arr[j] < arr[j-1]){
					int big = arr[j-1];
					arr[j-1] = arr[j];
					arr[j] = big;
					count++;
					flag = 1;
				}
			}
			i++;
		}
		for(int i = 0; i < n; i++){
			System.out.printf(i != n-1? "%d " : "%d\n", arr[i]);
		}
	}
}

Compiler output:
Main.java:13: error: incompatible types: int cannot be converted to boolean
		boolean flag = 1;
		               ^
Main.java:16: error: incompatible types: int cannot be converted to boolean
			flag = 0;
			       ^
Main.java:23: error: incompatible types: int cannot be converted to boolean
					flag = 1;
					       ^
Main.java:28: error: variable i is already defined in method main(String[])
		for(int i = 0; i < n; i++){
		        ^
4 errors
Language: Java

import java.io.*
public class Main{
  public static void main(String[] args){
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    int data [] = int[n];
    int count = 0;

    for(int i=0; i<n; i++){
      for(int j=0; j<n-i; j++){
        if(data[j]<data[j+1]){
          int temp=data[j];
          data[j]=data[j+1];
          data[j+1]=temp;
          count += 1;
        }
      }
    }
    for(int k=0; k<data.length; k++){
      System.out.print(data[k]+" ");
      System.out.println(count);
    }
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.io.*
                ^
Main.java:6: error: ']' expected
    int data [] = int[n];
                      ^
Main.java:6: error: ';' expected
    int data [] = int[n];
                       ^
3 errors
Language: Java

import java.io.* ;
public class Main{
  public static void main(String[] args){
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    int data [] = new int[n];
    int count = 0;

    for(int i=0; i<n; i++){
      for(int j=0; j<n-i; j++){
        if(data[j]<data[j+1]){
          int temp=data[j];
          data[j]=data[j+1];
          data[j+1]=temp;
          count += 1;
        }
      }
    }
    for(int k=0; k<data.length; k++){
      System.out.print(data[k]+" ");
      System.out.println(count);
    }
  }
}

Compiler output:
Main.java:5: error: unreported exception IOException; must be caught or declared to be thrown
    int n = Integer.parseInt(br.readLine());
                                        ^
1 error
Language: Java

import java.io.* ;
public class Main{
  public static void main(String[] args) throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    int data [] = new data [n];
    int count = 0;
  
    for(int i=0; i<n; i++){
      for(int j=0; j<n-i; j++){
        if(data[j]<data[j+1]){
          int temp=data[j];
          data[j]=data[j+1];
          data[j+1]=temp;
          count += 1;
        }
      }
    }
    for(int k=0; k<data.length; k++){
      System.out.print(data[k]+" ");
      System.out.println(count);
    }
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    int data [] = new data [n];
                      ^
  symbol:   class data
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.*;
 
 
class Main{
      public static void main(String[] args) thorows IOException{
       int n =0;
       int [] suuji;
       int count =0;

         Scanner scanner = new Scanner(System.int);
         int n = scanner.nexrInt();
         int [] suuji = new int[n];

         for(int i=0; i<n; i++){
             suuji[i] = scanner.nextInt();

           }

          for(int j=0; j<suuji.length-1; j++){
            for(int k=n; k<suuji.length-1; k++){
                if(suuji[k] < suuji[k-1]){
                    int a = suuji[k];
                    int b = suuji[k-1];
                    suuji[k] = b;
                    suuji[k-1]= a;
                    count++;
                }
              }
           System,out.print(suuji[j] + " ");
           }
           System.out.println(count);
}
         

Compiler output:
Main.java:6: error: ';' expected
      public static void main(String[] args) thorows IOException{
                                            ^
Main.java:11: error: <identifier> expected
         Scanner scanner = new Scanner(System.int);
                                              ^
Main.java:11: error: ';' expected
         Scanner scanner = new Scanner(System.int);
                                                 ^
Main.java:30: error: not a statement
           System,out.print(suuji[j] + " ");
           ^
Main.java:30: error: ';' expected
           System,out.print(suuji[j] + " ");
                 ^
Main.java:33: error: reached end of file while parsing
}
 ^
6 errors
Language: Java

import java.io.*;
import java.util.*;
 
 
class Main{
      public static void main(String[] args) throws IOException{
       int n =0;
       int [] suuji;
       int narabi =0;
       int count =0;

         Scanner scanner = new Scanner(System.in);
         int n = scanner.nexrInt();
         int [] suuji = new int[n];

         for(int i=0; i<n; i++){
             suuji[i] = scanner.nextInt();

           }

          for(int j=0; j<suuji.length-1; j++){
            for(int k=n; k<suuji.length-1; k++){
                if(suuji[k] < suuji[k-1]){
                    int a = suuji[k];
                    int b = suuji[k-1];
                    suuji[k] = b;
                    suuji[k-1]= a;
                    count++;
                }
              }
           narabi = suuji[j];
           System,out.print(narbai+ " ");
           }
           System.out.println(count);
     }
  }
}
         

Compiler output:
Main.java:32: error: not a statement
           System,out.print(narbai+ " ");
           ^
Main.java:32: error: ';' expected
           System,out.print(narbai+ " ");
                 ^
Main.java:37: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.io.*;
import java.util.*;
   
class Main{
      public static void main(String[] args) {
       int count =0;
       Scanner sc = new Scanner(System.in);
       while(sc.hasNext()){
           int n = sc.nextInt();
           int [] array = new int[n];
         for(int i=0; i<n-1; i++){
             array[i] = sc.nextInt();
           }
  
          for(int j=0; j<array.length-1; j++){
            for(int k=n-1; j<k; k--){
                if(array[k] < array[k-1]){
                    int a = array[k];
                    int b = array[k-1];
                    array[k] = b;
                    array[k-1]= a;
                    count++;
                }
              }
           }
         for (int i = 1; i < n-1; i++) {
            System.out.print(" " + a[i]);
        }
        System.out.println(count);

     }
  }

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

import java.io.*;
import java.util.*;
   
class Main{
      public static void main(String[] args) {
       int count =0;
       Scanner sc = new Scanner(System.in);
       while(sc.hasNext()){
           int n = sc.nextInt();
           int [] array = new int[n];
         for(int i=0; i<n-1; i++){
             array[i] = sc.nextInt();
           }
}
  
          for(int j=0; j<array.length-1; j++){
            for(int k=n-1; j<k; k--){
                if(array[k] < array[k-1]){
                    int a = array[k];
                    int b = array[k-1];
                    array[k] = b;
                    array[k-1]= a;
                    count++;
                }
              }
           }
         for (int i = 1; i < n-1; i++) {
            System.out.print(" " + a[i]);
        }
        System.out.println(count);

     }
  }

Compiler output:
Main.java:16: error: cannot find symbol
          for(int j=0; j<array.length-1; j++){
                         ^
  symbol:   variable array
  location: class Main
Main.java:17: error: cannot find symbol
            for(int k=n-1; j<k; k--){
                      ^
  symbol:   variable n
  location: class Main
Main.java:18: error: cannot find symbol
                if(array[k] < array[k-1]){
                   ^
  symbol:   variable array
  location: class Main
Main.java:18: error: cannot find symbol
                if(array[k] < array[k-1]){
                              ^
  symbol:   variable array
  location: class Main
Main.java:19: error: cannot find symbol
                    int a = array[k];
                            ^
  symbol:   variable array
  location: class Main
Main.java:20: error: cannot find symbol
                    int b = array[k-1];
                            ^
  symbol:   variable array
  location: class Main
Main.java:21: error: cannot find symbol
                    array[k] = b;
                    ^
  symbol:   variable array
  location: class Main
Main.java:22: error: cannot find symbol
                    array[k-1]= a;
                    ^
  symbol:   variable array
  location: class Main
Main.java:27: error: cannot find symbol
         for (int i = 1; i < n-1; i++) {
                             ^
  symbol:   variable n
  location: class Main
Main.java:28: error: cannot find symbol
            System.out.print(" " + a[i]);
                                   ^
  symbol:   variable a
  location: class Main
10 errors
Language: Java

import java.io.*;
import java.util.*;
   
class Main{
      public static void main(String[] args) {
       int count =0;
       Scanner sc = new Scanner(System.in);
       while(sc.hasNext()){
           int n = sc.nextInt();
           int [] array = new int[n];
         for(int i=0; i<n-1; i++){
             array[i] = sc.nextInt();
           }
 
          for(int j=0; j<array.length-1; j++){
            for(int k=n-1; j<k; k--){
                if(array[k] < array[k-1]){
                    int a = array[k];
                    int b = array[k-1];
                    array[k] = b;
                    array[k-1]= a;
                    count++;
                }
              }
           }
         for (int i = 1; i < n-1; i++) {
            System.out.print(" " + a[i]);
        }
        System.out.println(count);

     }
  }
}

Compiler output:
Main.java:27: error: cannot find symbol
            System.out.print(" " + a[i]);
                                   ^
  symbol:   variable a
  location: class Main
1 error
Language: Java

class Main extends MyUtil{
    // public static ArrayList<ArrayList<Integer>> g;
    public static Graph g;
     
    public static void main(String[] args) throws Exception{
        int n = readInt();
        int[] a = readIntMap();
        int count = 0;
        for (int i = 0; i < n-1; i++) {
            for (int j = n-1; j > i; j--) {
                if(a[j] < a[j-1]){
                    int tmp = a[j];
                    a[j] = a[j-1];
                    a[j-1] = tmp;
                    count++;
                }
            }
        }
        System.out.print(a[0]);
        for (int i = 1; i < n; i++) {
            System.out.print(" " + a[i]);
        }
        System.out.println();
        System.out.println(count);
    }
}

Compiler output:
Main.java:1: error: cannot find symbol
class Main extends MyUtil{
                   ^
  symbol: class MyUtil
Main.java:3: error: cannot find symbol
    public static Graph g;
                  ^
  symbol:   class Graph
  location: class Main
Main.java:6: error: cannot find symbol
        int n = readInt();
                ^
  symbol:   method readInt()
  location: class Main
Main.java:7: error: cannot find symbol
        int[] a = readIntMap();
                  ^
  symbol:   method readIntMap()
  location: class Main
4 errors
Language: Java

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

class Main extends MyUtil{
    // public static ArrayList<ArrayList<Integer>> g;
    public static Graph g;
      
    public static void main(String[] args) throws Exception{
        int n = readInt();
        int[] a = readIntMap();
        int count = 0;
        for (int i = 0; i < n-1; i++) {
            for (int j = n-1; j > i; j--) {
                if(a[j] < a[j-1]){
                    int tmp = a[j];
                    a[j] = a[j-1];
                    a[j-1] = tmp;
                    count++;
                }
            }
        }
        System.out.print(a[0]);
        for (int i = 1; i < n; i++) {
            System.out.print(" " + a[i]);
        }
        System.out.println();
        System.out.println(count);
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
class Main extends MyUtil{
                   ^
  symbol: class MyUtil
Main.java:7: error: cannot find symbol
    public static Graph g;
                  ^
  symbol:   class Graph
  location: class Main
Main.java:10: error: cannot find symbol
        int n = readInt();
                ^
  symbol:   method readInt()
  location: class Main
Main.java:11: error: cannot find symbol
        int[] a = readIntMap();
                  ^
  symbol:   method readIntMap()
  location: class Main
4 errors
Language: Java

import java.io.*;
import java.util.*;
   
class Main{
      public static void main(String[] args) {
       int narabi =0;
       int count =0;
       Scanner sc = new Scanner(System.in);
           int n = sc.nextInt();
           int [] array = new int[n];
         for(int i=0; i<n; i++){
             array[i] = sc.nextInt();
           }
            
          for(int i=0; i<array.length-1; i++){
            for(int j=array.length-1; j>0; j--){
                if(array[j] < array[j-1]){
                    int a = array[j];
                    int b = array[j-1];
                    array[j] = b;
                    array[j-1]= a;
                    count++;
                }
              }
           }
            for(int k =0; k<array.length; k++){
            int number = array[k];
            System.out.print(number + '');
             }
             System.out.println("\n" + count);
        }
 
     }

Compiler output:
Main.java:28: error: empty character literal
            System.out.print(number + '');
                                      ^
1 error
Language: Java



import java.util.Scanner;

public class bubbleSort {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		int sortLong=input.nextInt();
		
		int[] sortNumber=new int[sortLong];
		
		for(int i=0;i<sortLong;i++)
			sortNumber[i]=input.nextInt();
		
		int number=sort(sortNumber);
		
		for(int i=0;i<sortNumber.length;i++)
			System.out.print(sortNumber[i]+" ");
		System.out.println();
		System.out.println(number);
		
	}
	
	public static int sort(int[] sortArray){
		int minNumber;
		int changeFrequency=0;
		
		for(int i=0;i<sortArray.length-1;i++){
			for(int j=0;j<sortArray.length-1;j++){
				if(sortArray[j]>sortArray[j+1]){
					minNumber=sortArray[j+1];
					
					sortArray[j+1]=sortArray[j];
					sortArray[j]=minNumber;
					
					changeFrequency++;
				}
				
			}
		}
		
		return changeFrequency;
	}

}

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

import java.util.Scanner;

public class BubbleSort {
    private static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int n=sc.nextInt();
        int[] a=new int[n];
        for(int i=0;i<n;i++) a[i]=sc.nextInt();
        boolean flag=true;
        int counter=0;
        while(flag){
            flag=false;
            for(int j=n-1;j>=1;j--){
                if(a[j]<a[j-1]){
                    int t=a[j];
                    a[j]=a[j-1];
                    a[j-1]=t;
                    counter++;
                    flag=true;
                }
            }        
        }
        for(int i=0;i<=n-2;i++) System.out.printf("%d ",a[i]);
        System.out.println(a[n-1]);
        System.out.println(counter);
    }
}

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

import java.io.*;
class Main{

public static void main(String[] args)
{
BufferedReader br=new BufferedReader(new InputStreamReader(system.in));
int n=br.readLine();
int[] arr=new int[n];

String[] ip=br.readLine().split(" ");
for(int i=0;i<n;i++)
arr[i]=Integer.parseInt(ip[i]);
int swap=0;
for(int i=0;i<n-1;i++)
for(int j=0;j<n-1-i;j++)
{
if(arr[j]>arr[j+1])
{
arr[j]=arr[j]+arr[j+1];
arr[j+1]=arr[j]-arr[j+1];
arr[j]=arr[j]-arr[j+1];
swap++;
}
}
for(int i=0;i<n;i++)
System.out.print(arr[i]+" ");
System.out.println();
System.out.print(swap);
}
}

Compiler output:
Main.java:6: error: cannot find symbol
BufferedReader br=new BufferedReader(new InputStreamReader(system.in));
                                                           ^
  symbol:   variable system
  location: class Main
Main.java:7: error: incompatible types: String cannot be converted to int
int n=br.readLine();
                 ^
2 errors
Language: Java

import java.util.Scanner;

public class BubbleSort {

	public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		
		int num = scan.nextInt();
		int nums;
		int cnt = 0;
		int num1[];
		num1 = new int[num]; 
		
		for(int i=0; i<num; i++)
			num1[i] = scan.nextInt();
		
		for(int i=0; i<num; i++){
			
			for(int j=num-1; j>=i+1; j--){
				if(num1[j] < num1[j-1]){
					nums = num1[j];
					num1[j]=num1[j-1];
					num1[j-1]=nums;
					cnt++;
				}
			}
		}	
		for(int i=0; i<num; i++){
			if(i>0)System.out.print(" ");
			System.out.print(num1[i]);
			if(i==num-1)System.out.println();
		}
		System.out.println(cnt);
		
	}

}

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

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

public class BubbleSort {

	public static void main(String[] args)throws IOException{
		
		Scanner scan = new Scanner(System.in);
		
		int num = scan.nextInt();
		int nums;
		int cnt = 0;
		int num1[];
		num1 = new int[num]; 
		
		for(int i=0; i<num; i++)
			num1[i] = scan.nextInt();
		
		for(int i=0; i<num; i++){
			
			for(int j=num-1; j>=i+1; j--){
				if(num1[j] < num1[j-1]){
					nums = num1[j];
					num1[j]=num1[j-1];
					num1[j-1]=nums;
					cnt++;
				}
			}
		}	
		for(int i=0; i<num; i++){
			if(i>0)System.out.print(" ");
			System.out.print(num1[i]);
			if(i==num-1)System.out.println();
		}
		System.out.println(cnt);
		
	}

}

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

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc =new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums  =new int[n];
		bubbleSort(nums);
	}
	public static void bubbleSort(int[] A){
		for(int i=0;i<N;i++){
			for(int j=1;j<N-i;j++){
				if(A[j]<A[j-1]){
					int t = A[j];
					A[j] = A[j-1];
					A[j-1] = t; 
				}
			}
		}
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
		for(int i=0;i<N;i++){
		              ^
  symbol:   variable N
  location: class Main
Main.java:11: error: cannot find symbol
			for(int j=1;j<N-i;j++){
			              ^
  symbol:   variable N
  location: class Main
2 errors
Language: Java

import java.util.*;
public class BubbleSort{
	static int count = 0 ;
	public static void main(String args[]){
		Scanner sc =new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums  =new int[n];
		for(int i=0;i<n;i++){
			nums[i] = sc.nextInt();
		}
		bubbleSort(nums);
		for(int x:nums){
			System.out.print(x+" ");
		}
		System.out.println();
		System.out.println(count);
	}
	public static void bubbleSort(int[] A){
		int N = A.length;
		for(int i=0;i<N;i++){
			for(int j=1;j<N-i;j++){
				if(A[j]<A[j-1]){
					count++;
					int t = A[j];
					A[j] = A[j-1];
					A[j-1] = t; 
				}
			}
		}
	}
}

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

mport java.util.*;
public class Main {
	public static void main(String args[]){
		Scanner sc  =new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int i=0;i<n;i++){
			nums[i] = sc.nextInt();
		}
		BubbleSort(nums);
		
		
	}
	public static void  BubbleSort(int[] nums){
		int swap_count =0;
		for(int i=0;i<nums.length;i++){
			for(int j=1;j<nums.length-i;j++){
				if(nums[j]<nums[j-1]){
					swap(nums,j,j-1);
					swap_count++;
				}
			}
		}
		for(int i=0;i<nums.length;i++){
			if(i==0)System.out.print(nums[i]);
			else System.out.print(" "+nums[i]);
		}
		System.out.println();
		System.out.println(swap_count);
	}
	public static void swap(int[] nums,int i,int j){
		int temp = nums[i];
		nums[i] = nums[j];
		nums[j] = temp; 
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: Java

import java.util.Scanner;
import java.util.*;
public class BubbleSort {
    public static void main(String[] args) {
	Scanner stdin = new Scanner(System.in);
	int n = stdin.nextInt();
	int[] num = new int[100];
	int cnt = 0;

	for ( int i = 0; i < n; i++ ){
	    num[i] = stdin.nextInt();
	}

	int flag = 1;
	while ( flag == 1 ){
	    flag = 0;
	    for ( int j = n-1; j > 0; j-- ){
		if ( num[j] < num[j-1] ){
		    int tmp = num[j];
		    num[j] = num[j-1];
		    num[j-1] = tmp;
		    flag = 1;
		    cnt++;
		    System.out.println(cnt);
		}
	    }
	}

	for ( int i = 0; i < n; i++ ){
	    System.out.print(num[i] + " ");
	}
	System.out.println();
	System.out.println(cnt);

    }
}

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

import java.util.Scanner;
import java.util.*;
public class BubbleSort {
    public static void main(String[] args) {
	Scanner stdin = new Scanner(System.in);
	int n = stdin.nextInt();
	int[] num = new int[100];
	int cnt = 0;

	for ( int i = 0; i < n; i++ ){
	    num[i] = stdin.nextInt();
	}

	int flag = 1;
	while ( flag == 1 ){
	    flag = 0;
	    for ( int j = n-1; j > 0; j-- ){
		if ( num[j] < num[j-1] ){
		    int tmp = num[j];
		    num[j] = num[j-1];
		    num[j-1] = tmp;
		    flag = 1;
		    cnt++;
		}
	    }
	}

	for ( int i = 0; i < n; i++ ){
	    System.out.print(num[i] + " ");
	}
	System.out.println();
	System.out.println(cnt);

    }
}

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

mport java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		boolean flag = true;
		int swapCount = 0;
		while(flag) {
			flag = false;
			for(int j = n - 1; j > 0; j--) {
				if(nums[j] < nums[j - 1]) {
					int work = nums[j];
					nums[j] = nums[j - 1];
					nums[j - 1] = work;
					flag = true;
					swapCount++;
				}
			}
		}
		printArray(nums);
		System.out.println(swapCount);
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

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

class Main{
	public static void main(String[] args)throws Exception{
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[] numbers = new int[n];
		int couont = 0;
		int temp = 0;
		int flag = 1;

		while(frag == 1){
			frag = 0;
			for(int i = n-1; i > 0; i--){
				if(numbers[i] - numbers[i-1]){
					temp = numbers[i];
					numbers[i] = numbers[i-1];
					numbers[i-1] = temp;
					frag = 1;
					count++;
				}
			}
		}

		System.out.println(count);
		for(int i = 0; i < n; i++){
			if(i = n-1){
				System.out.print(numbers[i]);
				System.out.print("\n");
			}else{
				System.out.print(numbers[i] + " ");
			}
		}
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
		while(frag == 1){
		      ^
  symbol:   variable frag
  location: class Main
Main.java:16: error: cannot find symbol
			frag = 0;
			^
  symbol:   variable frag
  location: class Main
Main.java:18: error: incompatible types: int cannot be converted to boolean
				if(numbers[i] - numbers[i-1]){
				              ^
Main.java:22: error: cannot find symbol
					frag = 1;
					^
  symbol:   variable frag
  location: class Main
Main.java:23: error: cannot find symbol
					count++;
					^
  symbol:   variable count
  location: class Main
Main.java:28: error: cannot find symbol
		System.out.println(count);
		                   ^
  symbol:   variable count
  location: class Main
Main.java:30: error: incompatible types: int cannot be converted to boolean
			if(i = n-1){
			     ^
7 errors
Language: Java

import java.util.List;

class Main {

	public static void main(String[] args) {

		Input stdIn = new Input();

		int n = stdIn.getValue();
		List<Integer> values = stdIn.getLine();

		bubbleSort(values, n);

		stdIn.close();

	}

	public static void bubbleSort(List<Integer> values, int n) {

		int count = 0;

		for (int i = n; i > 1; i--) {
			for (int j = 0; j < i - 1; j++) {
				if (values.get(j) > values.get(j + 1)) {
					values.add(j, values.get(j + 1));
					values.remove(j + 2);
					count++;
				}
			}
		}
		StringBuilder output = new StringBuilder();
		for(int k = 0; k < values.size(); k++) {
			output.append(values.get(k) + " ");
		}
		System.out.println(output.delete(output.length()-1, output.length()));
		System.out.println(count);
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		Input stdIn = new Input();
		^
  symbol:   class Input
  location: class Main
Main.java:7: error: cannot find symbol
		Input stdIn = new Input();
		                  ^
  symbol:   class Input
  location: class Main
2 errors
Language: Java

import java.util.List;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public Main {

	public static void main(String[] args) {

		Input stdIn = new Input();

		int n = stdIn.getValue();
		List<Integer> values = stdIn.getLine();

		bubbleSort(values, n);

		stdIn.close();

	}

	public static void bubbleSort(List<Integer> values, int n) {

		int count = 0;

		for (int i = n; i > 1; i--) {
			for (int j = 0; j < i - 1; j++) {
				if (values.get(j) > values.get(j + 1)) {
					values.add(j, values.get(j + 1));
//					System.out.println(values);
					values.remove(j + 2);
					count++;
				}
//				System.out.println(values);
//				System.out.println(count);
			}
		}
		StringBuilder output = new StringBuilder();
		for(int k = 0; k < values.size(); k++) {
			output.append(values.get(k) + " ");
		}
		System.out.println(output.delete(output.length()-1, output.length()));
		System.out.println(count);
	}
}
class Input {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public int getValue() {
		int n = 0;
		try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return n;
	}

	public List<Integer> getValueLines(int n) {
		List<Integer> values = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			values.add(getValue());
		}
		return values;
	}

	public List<Integer> getLine() {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public void close() {
		try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Compiler output:
Main.java:9: error: class, interface, enum, or record expected
public Main {
       ^
Main.java:11: 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)
Main.java:47: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.Scanner;

public class Main {

	// define variables & initialize
	private static int cnt = 0;	// how many bubbleSort is used
	
	// sort method :: sort given array using insertion Sort
	public static void sort(int[] _A, int _n) {
		int flg = 1;
		while (flg != 0) {
			flg = 0;
			for (int i = _n - 1; i >= 1; --i) {
				if (_A[i] < _A[i - 1]) {
					_A[i] = _A[i] ^ _A[i - 1];
					_A[i - 1] = _A[i] ^ _A[i - 1];
					_A[i] = _A[i] ^ _A[i - 1];
					flg = 1;
					++cnt;
				}
			}
		}
		
	}
	
	// print method :: print array
	public static void print(int[] _A) {
		for (int i = 0; i < _A.length; ++i) {
			System.out.print(_A[i]);
			if (i != _A.length - 1)
				System.out.print(" ");
		}
		System.out.println();
	}
	
	// get method :: get cnt (how many bubbleSort was used)
	public static int get() {
		return cnt;
	}
public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		////////////////////////////////////
		int n = 0;
		int[] A;
		
		n = sc.nextInt();
		A = new int[n];
		
		for (int i = 0; i < n; ++i) {
			A[i] = sc.nextInt();
		}
		
		_bubbleSort.sort(A, n);
		_bubbleSort.print(A);
		System.out.println(_bubbleSort.get());
		
		////////////////////////////////////
		sc.close();
	}



}

Compiler output:
Main.java:53: error: cannot find symbol
		_bubbleSort.sort(A, n);
		^
  symbol:   variable _bubbleSort
  location: class Main
Main.java:54: error: cannot find symbol
		_bubbleSort.print(A);
		^
  symbol:   variable _bubbleSort
  location: class Main
Main.java:55: error: cannot find symbol
		System.out.println(_bubbleSort.get());
		                   ^
  symbol:   variable _bubbleSort
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Main {

	// define variables & initialize
	private static int cnt = 0;	// how many bubbleSort is used
	
	// sort method :: sort given array using insertion Sort
	public static void sort(int[] _A, int _n) {
		int flg = 1;
		while (flg != 0) {
			flg = 0;
			for (int i = _n - 1; i >= 1; --i) {
				if (_A[i] < _A[i - 1]) {
					_A[i] = _A[i] ^ _A[i - 1];
					_A[i - 1] = _A[i] ^ _A[i - 1];
					_A[i] = _A[i] ^ _A[i - 1];
					flg = 1;
					++cnt;
				}
			}
		}
		
	}
	
	// print method :: print array
	public static void print(int[] _A) {
		for (int i = 0; i < _A.length; ++i) {
			System.out.print(_A[i]);
			if (i != _A.length - 1)
				System.out.print(" ");
		}
		System.out.println();
	}
	
	// get method :: get cnt (how many bubbleSort was used)
	public static int get() {
		return cnt;
	}
public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		////////////////////////////////////
		int n = 0;
		int[] A;
		
		n = sc.nextInt();
		A = new int[n];
		
		for (int i = 0; i < n; ++i) {
			A[i] = sc.nextInt();
		}
		
		sort(A, n);
		print(A);
		System.out.println(_bubbleSort.get());
		
		////////////////////////////////////
		sc.close();
	}



}

Compiler output:
Main.java:55: error: cannot find symbol
		System.out.println(_bubbleSort.get());
		                   ^
  symbol:   variable _bubbleSort
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner;
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int count = 0;
        boolean flag = true;
        for(int i = 0; flag; i++){
            flag = false;
            for(int j = num - 1; j >= i; j--){
                if(array[j - 1] > array[j]){
                    int temp = array[j - 1];
                    array[j - 1] = array[j];
                    array[j] = temp;
                    flag = true;
                    count++;
                }
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
        
    }
}


Compiler output:
Main.java:5: error: '(' or '[' expected
        Scanner sc = new Scanner;
                                ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		
		Scanner sc= new Scanner (System.in);
		
		final int n = Integer.parseInt(sc.nextLine());
		String[] s = sc.nextLine().split();
		int[] num = new num[n];
		int cnt=0;
		
		for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(s[i]);
		}
		
		boolean flag=true;
		while(flag){
			flag=false;
			for(int i=n-1;i<2;i--){
				if(num[i]<num[i-1]){
					int str = num[i];
					num[i]=num[i-1];
					num[i-1]=str;
					cnt=+1;
					flag=true;
				}
			}
		}
		for(int i=0;i<n-1;i++){
			System.out.print(num[i]+" ");
		}
		System.out.println(num[n-1]);
		System.out.println(cnt);
	}
}


Compiler output:
Main.java:9: error: no suitable method found for split(no arguments)
		String[] s = sc.nextLine().split();
		                          ^
    method String.split(String,int) is not applicable
      (actual and formal argument lists differ in length)
    method String.split(String,int,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method String.split(char,int,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method String.split(String) is not applicable
      (actual and formal argument lists differ in length)
Main.java:10: error: cannot find symbol
		int[] num = new num[n];
		                ^
  symbol:   class num
  location: class Main
2 errors
Language: Java

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

public class BubbleSort{
    public static void main(String[] args){
        int N;
        int num[];
        String line;

        BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

        try{
            line=reader.readLine();
            N=Integer.parseInt(line);

            if(N<1||100<N){
                return;
            }
            
            num=new int[N];
            Scanner scan=new Scanner(System.in);

            for(int i=0;i<N;i++){
                num[i]=Integer.parseInt(scan.next());
                if(num[i]<0||num[i]>100){
                    return;
                }
            }

            //バブルソート
            int swap_num=0;
            for(int i=0;i<N-1;i++){
                for(int j=N-1;j>i;j--){
                    if(num[j]<num[j-1]){
                        int temp=num[j];
                        num[j]=num[j-1];
                        num[j-1]=temp;

                        swap_num++;
                    }
                }
            }

            for(int i=0;i<N;i++){
                System.out.print(num[i]+" ");
            }
            System.out.println();
            System.out.println(swap_num);
        }
        catch(IOException e){
            System.out.println(e);
        }
        catch(NumberFormatException e){
            System.out.println(e);
        }
    }
}


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

import java.util.Scanner;
public class practice{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int []array=new int[N];
        for(int i=0;i<N;i++)array[i]=sc.nextInt();
        int num=0;
        for(int i=N;i>=1;i--){
            for(int j=0;j<i-1;j++){
                if(array[j+1]>array[j]){
                    int tmp=array[j];
                    array[j]=array[j+1];
                    array[j+1]=tmp;
                    num++;
                }
            }
        }
        for(int i=0;i<N;i++){
            System.out.print(array[i]);
            if(i<N-1)System.out.print(" ");
        }
        System.out.println();
        System.out.println(num);

        
    }
}


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

import java.util.Scanner;
public class practice{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int []array=new int[N];
        for(int i=0;i<N;i++)array[i]=sc.nextInt();
        int num=0;
        for(int i=N;i>=1;i--){
            for(int j=0;j<i-1;j++){
                if(array[j+1]<array[j]){
                    int tmp=array[j];
                    array[j]=array[j+1];
                    array[j+1]=tmp;
                    num++;
                }
            }
        }
        for(int i=0;i<N;i++){
            System.out.print(array[i]);
            if(i<N-1)System.out.print(" ");
        }
        System.out.println();
        System.out.println(num);

        
    }
}


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

import java.util.Scanner;

public class BubbleSort{
    public static void main(String[] args){
        int N;
        int num[];
        String line;

        Scanner scan=new Scanner(System.in);

        line=scan.next();
        N=Integer.parseInt(line);

        if(N<1||100<N){
            return;
        }
        
        num=new int[N];

        for(int i=0;i<N;i++){
            num[i]=Integer.parseInt(scan.next());
            if(num[i]<0||num[i]>100){
                return;
            }
        }

        //バブルソート
        int swap_num=0;
        for(int i=0;i<N-1;i++){
            for(int j=N-1;j>i;j--){
                if(num[j]<num[j-1]){
                    int temp=num[j];
                    num[j]=num[j-1];
                    num[j-1]=temp;

                    swap_num++;
                }
            }
        }

        for(int i=0;i<N;i++){
            System.out.print(num[i]+" ");
        }
        System.out.println();
        System.out.println(swap_num);
    }
}


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

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int A[] = new int[N];

        for(int i = 0; i < N; i++)
            A[i] = sc.nextInt();

        int count = 0;
        int flag = 1;
        int tmp;

        while (flag != 0) {
            flag = 0;
            for(int j = N - 1; j > 0; j--) {
                if(A[j] < A[j-1]) {
                    tmp = A[j];
                    A[j] = A[j - 1];
                    A[j - 1] = tmp;
                    flag = 1;
                    count++;
                }
            }
        }
        System.out.print(A[0]);
        for(int i = 1; i < N; i++) {
            System.out.print(" " + A[i]);
        System.out.println("");
        System.out.println(count);
    }
}


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

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

public class Graph {

    int[] arr;

    int size;

    int swaps;

    public static void main(String[] args)
    {

        Graph g = new Graph();

        g.readArray();

        g.bubbleSort();

        g.printArray();

        System.out.print("\n" + g.swaps);
    }

    private void readArray() {

        InputReader reader = new InputReader(System.in);

        size = reader.nextInt();

        arr = new int[size];

        for(int i=0; i<size; ++i)
            arr[i] = reader.nextInt();
    }

    private void printArray() {

        PrintWriter writer = new PrintWriter(System.out);

        for(int elem : arr)
            writer.print(elem + " ");

        writer.flush();
    }


    private void bubbleSort() {

        boolean flag=false;

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

            flag=false;

            for(int j=i+1; j<size; ++j) {

                if(arr[i]>arr[j]) {

                    flag=true;

                    ++swaps;

                    int tmp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = tmp;
                }
            }

            // no swap has taken place so array is already sorted at this point
            if(!flag) break;
        }

    }


    class InputReader {

        private BufferedReader reader;

        private StringTokenizer tokenizer;

        InputReader(InputStream ip) {

            reader = new BufferedReader(new InputStreamReader(ip));
        }

        String next() {

            if(tokenizer==null || !tokenizer.hasMoreTokens()) {

                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            return tokenizer.nextToken();
        }

        int nextInt() {

            return Integer.parseInt(next());
        }
    }
}



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

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }
    int b = 1;
    int count = 0;
    boolean sort = true;
    while(true) {
      sort = false;
      for(int i = n - 1; i > b - 1; i--) {
        if(a[i] < a[i - 1]) {
          int v = a[i];
          a[i] = a[i - 1];
          a[i - 1] = v;
          sort = true;
          count++;
        }
      }
      b++;
    }
    for(int i = 0; i < n; i++) {
      if(i == n - 1) {
        System.out.println(a[i]);
      } else {
        Sytem.out.print(a[i] + " ");
      }
    }
    System.out.println(count);
  }
}



Compiler output:
Main.java:31: error: package Sytem does not exist
        Sytem.out.print(a[i] + " ");
             ^
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }
    int b = 1;
    int count = 0;
    boolean sort = true;
    while(true) {
      sort = false;
      for(int i = n - 1; i > b - 1; i--) {
        if(a[i] < a[i - 1]) {
          int v = a[i];
          a[i] = a[i - 1];
          a[i - 1] = v;
          sort = true;
          count++;
        }
      }
      b++;
    }
    for(int i = 0; i < n; i++) {
      if(i == n - 1) {
        System.out.println(a[i]);
      } else {
        System.out.print(a[i] + " ");
      }
    }
    System.out.println(count);
  }
}



Compiler output:
Main.java:27: error: unreachable statement
    for(int i = 0; i < n; i++) {
    ^
1 error
Language: Java

import java.util.*;

public class Launcher {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }
    int b = 1;
    int count = 0;
    boolean sort = true;
    while(sort) {
      sort = false;
      for(int i = n - 1; i > b - 1; i--) {
        if(a[i] < a[i - 1]) {
          int v = a[i];
          a[i] = a[i - 1];
          a[i - 1] = v;
          sort = true;
          count++;
        }
      }
      b++;
    }
    for(int i = 0; i < n; i++) {
      if(i == n - 1) {
        System.out.println(a[i]);
      } else {
        System.out.print(a[i] + " ");
      }
    }
    System.out.println(count);
  }
}



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