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

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

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

	String N_str = br.readLine();
	int N = Integer.parseInt(N_str);

	int[] A;
	A = new int[N];
	
	String A_str = br.readLine();
	Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*");
	
	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

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



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:52:2: error: expected ';' after class definition
   52 | }
      |  ^
      |  ;
Language: C++

#include <stdio.h>

int main() {
	int N;
	int temp;
	int flag;
	int count = 0;
	int A[1000] = {};

	scanf("%d", &N);

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

	while(flag) {
		flag = 0;
		for(int i = 0; i < N-1; i++) {
			if(A[i] > A[i+1]) {
				temp = A[i+1];
				A[i+1] = A[i];
				A[i] = temp;
				flag = 1;
				count++;
			}
		}
	}
	for(int i = 0; i < N; i++) {
	       printf("%d", A[i]);
               if(i != N-1)   putchar(" ");
	}
	printf("\n%d\n", count);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:39: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   30 |                if(i != N-1)   putchar(" ");
      |                                       ^~~
      |                                       |
      |                                       const char*
In file included from a.cc:1:
/usr/include/stdio.h:618:25: note:   initializing argument 1 of 'int putchar(int)'
  618 | extern int putchar (int __c);
      |                     ~~~~^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
    int n; cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    int count = 0;
    
    for(int i=n-1;i>0;i—){
         for(int j=i;j>0;j—){
             if(a[j] < a[j-1]){
                    sawp(a[j] , a[j-1]);
                    count++;
              }
             else break;
           }
     } 
     cout<<a[0];
     for(int i=1;i<n;i++) cout<<" "<<a[i];
     cout<<endl<<count<<endl;
}
              


Compiler output:
a.cc:11:23: error: extended character — is not valid in an identifier
   11 |     for(int i=n-1;i>0;i—){
      |                       ^
a.cc:12:26: error: extended character — is not valid in an identifier
   12 |          for(int j=i;j>0;j—){
      |                          ^
a.cc: In function 'int main()':
a.cc:11:23: error: 'i\U00002014' was not declared in this scope
   11 |     for(int i=n-1;i>0;i—){
      |                       ^~
a.cc:12:26: error: 'j\U00002014' was not declared in this scope
   12 |          for(int j=i;j>0;j—){
      |                          ^~
a.cc:14:21: error: 'sawp' was not declared in this scope
   14 |                     sawp(a[j] , a[j-1]);
      |                     ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
    int n; cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    int count = 0;
    
    for(int i=n-1;i>0;i−−){
         for(int j=i;j>0;j−−){
             if(a[j] < a[j-1]){
                    sawp(a[j] , a[j-1]);
                    count++;
              }
             else break;
           }
     } 
     cout<<a[0];
     for(int i=1;i<n;i++) cout<<" "<<a[i];
     cout<<endl<<count<<endl;
}
              


Compiler output:
a.cc:11:23: error: extended character − is not valid in an identifier
   11 |     for(int i=n-1;i>0;i−−){
      |                       ^
a.cc:11:23: error: extended character − is not valid in an identifier
a.cc:12:26: error: extended character − is not valid in an identifier
   12 |          for(int j=i;j>0;j−−){
      |                          ^
a.cc:12:26: error: extended character − is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:23: error: 'i\U00002212\U00002212' was not declared in this scope
   11 |     for(int i=n-1;i>0;i−−){
      |                       ^~~
a.cc:12:26: error: 'j\U00002212\U00002212' was not declared in this scope
   12 |          for(int j=i;j>0;j−−){
      |                          ^~~
a.cc:14:21: error: 'sawp' was not declared in this scope
   14 |                     sawp(a[j] , a[j-1]);
      |                     ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
    int n; cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    int count = 0;
    
    for(int i=0;i<n-1;i++){
         for(int j=i;j<n-1;j++){
             if(a[j] > a[j+1]){
                    sawp(a[j] , a[jj+1]);
                    count++;
              }
             else break;
           }
     } 
     cout<<a[0];
     for(int i=1;i<n;i++) cout<<" "<<a[i];
     cout<<endl<<count<<endl;
}
              


Compiler output:
a.cc: In function 'int main()':
a.cc:14:35: error: 'jj' was not declared in this scope; did you mean 'j'?
   14 |                     sawp(a[j] , a[jj+1]);
      |                                   ^~
      |                                   j
a.cc:14:21: error: 'sawp' was not declared in this scope
   14 |                     sawp(a[j] , a[jj+1]);
      |                     ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
    int n; cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    int count = 0;
    
    for(int i=0;i<n-1;i++){
         for(int j=i;j<n-1;j++){
             if(a[j] > a[j+1]){
                    sawp(a[j] , a[j+1]);
                    count++;
              }
             else break;
           }
     } 
     cout<<a[0];
     for(int i=1;i<n;i++) cout<<" "<<a[i];
     cout<<endl<<count<<endl;
}
              


Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'sawp' was not declared in this scope
   14 |                     sawp(a[j] , a[j+1]);
      |                     ^~~~
Language: C++

#include<iostream>
using namespace std;
#define MAX 100
int BubbleSort(int x[],int n);

int main(){
	int i,N,count;
	int x[MAX] = {0} ;
	
	cin >> N ;

	for(i=0;i<N;i++){
		cin >> x[i] ;
	}

	count = BubbleSort(y,N);

	for(i=0;i<N;i++){

	if(i<(N-2))cout << x[i] << ' ' ;
	if(i == (N-1))cout << x[i] << endl ;

	}

	cout << count << endl ;
	return 0;

}

int BubbleSort(int x[],int n){
	int i,j,tmp,count=0;

	for(i=1;i<n;i++){
		for(j=(n-1);j>(i+1);j--){
			if(x[j] < x[j-1]){
				tmp = x[j] ;
				x[j] = x[j-1] ;
				x[j-1] = tmp ;
				count++;
			}
		}
	}


	return count ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: 'y' was not declared in this scope
   16 |         count = BubbleSort(y,N);
      |                            ^
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;

int main(){
	int N;
	cin >> N;
	int array[N];
	for(int i = 0; i <N; i++) cin >> array[i];
	int cnt = 0;
	for(int i = 0; i <= N-1; i++){
		for(int j = N-1;  j >= i+1; j--){
			if(array[j] < array[j-1]) {
				swap(array[j], array[j-1]);
				cnt++;
			}
		}
	}

	for(int i = 0; i < N-1; i++){
		printf("%d ", array[i]);
	}
	printf("%d\n", array[N-1]);
	printf("%d\n", cnt);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> N;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 |
Language: C++

#include<iostream>
using namespace std;
int main()
{
int n,a[100],ans=0;
cin >> n;
for(int i=0;i<n;i++)cin >> a[i];
for(int i=0;i<n;i++){
for(int j=n-1;j>=i+1;j--){
if(a[j]<a[j-1]){swap(a[j],a[j-1]);
}
}
for(int i=0;i<n;i++){
if(i==n-1)cout << a[i] << "\n";
else cout << a[i] << " ";
}
cout << ans << "\n";
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

import java.util.Scanner;
public class SelectionSort {
	private static int N_MAX = 99999;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.println(a[k]);
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
}



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

import java.util.Scanner;
public class SelectionSort{
	
	private static int N_MAX = 99999;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.println(a[k]);
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
}



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

import java.util.Arrays;
public class Main {        
	int[] random(int n) {        
		int[] a = new int[n];        
		for(int i = 0; i < n; i++) {            
			a[i] = (int)(Math.random() * 1000);       
		}        return a;    }        
	void swap(int[] a, int i, int j) {        
		int temp = a[i];        
		a[i] = a[j];        
		a[j] = temp;    
	}       
	void bubbleSort(int[] a) {       
		// バブルソート 未完成   
		for(int f =1; f<a.length; f++) {
		for(int i = 1; i < a.length; i++) {            
			if(a[i-1] > a[i]) {                
				swap(a, i-1, i);            
			}  
		}
		}    
	}   


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

import java.util.Arrays;public class Main { 
	int[] random(int n) {  
		int[] a = new int[n];  
		for(int i = 0; i < n; i++) {   
			a[i] = (int)(Math.random() * 1000);  
			}       return a;   
			} 
	void swap(int[] a, int i, int j) {  
		int temp = a[i];  a[i] = a[j];  a[j] = temp; }
	void bubbleSort(int[] a) {  
		// バブルソート 未完成  for(int f =1; f<a.length; f++)
		{  
			for(int i = 1; i < a.length; i++) {   
				if(a[i-1] > a[i]) {    swap(a, i-1, i);  
				}  
				}  
			} 
		} 
	void quickSort(int[] a) { 
		// クイックソートを作ります 
		} 
	void main() {  
		int[] a = {5, 3, 1, 9, 8, 0, 4, 2, 7, 6}; 
		//int[] a = random(100); 
		System.out.println("Before: " + Arrays.toString(a)); 
		long s = System.nanoTime();      
		bubbleSort(a);  
		System.out.println("After " + Arrays.toString(a)); 
		long e = System.nanoTime();  
		System.out.println("Time " + ((e - s) / 1000000f) + " ms");
		} 
	public static void main(String[] args) {  
		new Main().main();
		}
	}
	}
}


Compiler output:
Main.java:36: error: class, interface, enum, or record expected
	}
	^
1 error
Language: Java

package day6;
import java.util.Arrays;public class Main { 
	int[] random(int n) {  
		int[] a = new int[n];  
		for(int i = 0; i < n; i++) {   
			a[i] = (int)(Math.random() * 1000);  
			}       return a;   
			} 
	void swap(int[] a, int i, int j) {  
		int temp = a[i];  a[i] = a[j];  a[j] = temp; }
	void bubbleSort(int[] a) {  
		// バブルソート 未完成  for(int f =1; f<a.length; f++)
		{  
			for(int i = 1; i < a.length; i++) {   
				if(a[i-1] > a[i]) {    swap(a, i-1, i);  
				}  
				}  
			} 
		} 
	void quickSort(int[] a) { 
		// クイックソートを作ります 
		} 
	void main() {  
		int[] a = {5, 3, 1, 9, 8, 0, 4, 2, 7, 6}; 
		//int[] a = random(100); 
		System.out.println("Before: " + Arrays.toString(a)); 
		long s = System.nanoTime();      
		bubbleSort(a);  
		System.out.println("After " + Arrays.toString(a)); 
		long e = System.nanoTime();  
		System.out.println("Time " + ((e - s) / 1000000f) + " ms");
		} 
	public static void main(String[] args) {  
		new Main().main();
		}
	}
	}
}


Compiler output:
Main.java:37: error: class, interface, enum, or record expected
	}
	^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main102b {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int n=Integer.parseInt(br.readLine());
		StringTokenizer st=new StringTokenizer(br.readLine());
		int[] in=new int[n];
		for(int i=0;i<n;i++)in[i]=Integer.parseInt(st.nextToken());
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int mini=i;
			for(int j=i+1;j<n;j++){
				if(in[mini]>in[j]){
					mini=j;
				}
				}
			if(mini!=i){
				count++;
			int tmp=in[i];
			in[i]=in[mini];
			in[mini]=tmp;}
		}
		StringBuilder stb=new StringBuilder(Integer.toString(in[0]));
		for(int i=1;i<n;i++)stb.append(" "+in[i]);
		System.out.println(stb+"\r\n"+count);
		
	}

}

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

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

SelectionSort(A)
1 for i = 0 to A.length-1
2     mini = i
3     for j = i to A.length-1
4         if A[j] < A[mini]
5             mini = j
6     swap A[i] and A[mini]

入力例 1
5
5 3 2 4 1


*/

public class Main{ 

	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		BubbleSort sort = new BubbleSort(scan.nextInt());
		sort.loadSequence(scan);
		scan.close();
		sort.sort();
		System.out.println(sort);
		System.out.println(sort.swapTimes);
	}

}
class SelectionSort extends Sorting{
	public SelectionSort(int n){
		super(n);
	}
	@Override
	public void sort(){
		for(int i=0; i<seq.length-1;i++){
			int minIndex=i;
			for(int j=seq.length-1; i<j ;j--)
				if(seq[j]<seq[minIndex])
					minIndex = j;
			swap(i,minIndex);
		}
	}	
}
abstract class Sorting{
	int swapTimes;
	int[] seq;
	public Sorting(int n){
		swapTimes=0;
		seq = new int[n];
	}
	public void loadSequence(Scanner scan){
		for(int i=0; i<seq.length; i++)
			seq[i] = scan.nextInt();
	}
	@Override
	public String toString(){
		String tmp = "";
		for(int i=0; i<seq.length; i++)
			tmp = tmp + " " + seq[i];
		return tmp.trim();
	}
	void swap(int i, int j){
		swapTimes++;
		int tmp = seq[i];
		seq[i] = seq[j];
		seq[j] = tmp;
	}
	abstract public void sort();
}

Compiler output:
Main.java:24: error: cannot find symbol
		BubbleSort sort = new BubbleSort(scan.nextInt());
		^
  symbol:   class BubbleSort
  location: class Main
Main.java:24: error: cannot find symbol
		BubbleSort sort = new BubbleSort(scan.nextInt());
		                      ^
  symbol:   class BubbleSort
  location: class Main
2 errors
Language: Java

public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder out;

	void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

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

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

public class ALDS1_2_B {

	public static void main(String[] args) throws Exception {
		BufferedReader breader = getReader();
		int n = getInt(breader); 
		int[] num = getAry(breader);
		int snum = 0;
		for(int i = 0; i < n ; i++ ) {
			int mini=i;
			for( int j = i+1 ; j < n ; j++ ) {
				if ( num[mini] > num[j] ) {
					mini = j;
				}
			}
			if ( mini != i) {
				int k = num[mini];
				num[mini] = num[i];
				num[i] = k;
				snum++;
			}
		}
		putAry(num);
		System.out.println(snum);
	}
	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 int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}
	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(int[] 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(int[] 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_B is public, should be declared in a file named ALDS1_2_B.java
public class ALDS1_2_B {
       ^
1 error
Language: Java

import java.io.*;
import java.util.StringTokenizer;
 
class Main{
 
static final PrintWriter out=new PrintWriter(System.out);
static int ans=0;
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
SelectionSort(a);
getValue(a);
out.println(ans);
out.flush();
}
}
 
private static void swap(int[] a,int s,int t){
int tmp=a[s]; a[s]=a[t]; a[t]=tmp; ans++;
}
 
private static void SelectionSort(int[] a){
for(int i=0;i<n;i++){
int min=i;
for(int j=i;j<n;j++){
if(a[j]<a[min]){
min=j;
swap(a,i,min);
}
}
}
}
 
private static void getValue(int[] a){
for(int i=0;i<a.length-1;i++) out.print(a[i]+" ");
out.println(a[a.length-1]);
}
}

Compiler output:
Main.java:29: error: cannot find symbol
for(int i=0;i<n;i++){
              ^
  symbol:   variable n
  location: class Main
Main.java:31: error: cannot find symbol
for(int j=i;j<n;j++){
              ^
  symbol:   variable n
  location: class Main
2 errors
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());
      int[] iArr;
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length-1; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length-1; i++) {
        int minj = i;
        for(int j = i; j < iArr.length -1; j++) {
          if(iArr[j] < iArr[minj]) {
            int tmp = iArr[minj];
            iArr[minj] = iArr[j];
            iArr[j] = tmp;
            swapCount++;
          }
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  }
}

Compiler output:
Main.java:11: error: variable iArr might not have been initialized
        iArr[i] = Integer.parseInt(sArr[i]);
        ^
Main.java:14: error: variable iArr might not have been initialized
      for(int i = 0; i < iArr.length-1; i++) {
                         ^
2 errors
Language: Java

???

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = scan.nextInt();
		}
		selectionSrot(A, N);
		scan.close();
	}

	public static void selectionSrot(int[] A, int N) {
		// ???????????°
		int count = 0;
		
		for (int i = 0; i < N - 1; i++) {
			// ???????????????????????????????????\??¨
			int initialA = A[i];
			int minIndex = i;
			for (int j = i + 1; j < A.length; j++) {
				if (A[minIndex] > A[j]) {
					minIndex = j;
				}
			}
			// ????°??????????????????????????????¨??????
			int temp = A[i];
			A[i] = A[minIndex];
			A[minIndex] = temp;
			// ???????????????????????§??????
			if (initialA != A[i]) {
				count++;
			}

		}
		
		String output = Arrays.toString(A).replaceAll(",", "");
		System.out.println(output.substring(1, output.length() - 1));
		System.out.println(count);
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
???
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: Java

import java.lang.StringBuilder;
import java.lang.Math;

public class Main {
  private static int N;
  private static int[] a;

  private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  }

  private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  }
}

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

import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/6.
 */
public class ALDS1_2_B {
    static int si(String s){
        return Integer.parseInt(s);
    }

    static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    }
    public static void main(String[] args){
        run(args);
    }

}

Compiler output:
Main.java:6: error: class ALDS1_2_B is public, should be declared in a file named ALDS1_2_B.java
public class ALDS1_2_B {
       ^
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;
		for(int i = 0; i < n; i++){
			int minj = i;
			for(int j = i; j < n; j++){
				if(arr[j] < arr[minj]){
					minj = j;
				}
			}
			int small = arr[minj]
			arr[minj] = arr[i];
			arr[i] = small;
			count++;
		}

		for(int i = 0; i < n; i++){
			System.out.printf(i != n-1? "%d ": "%d\n", arr[i]);
		}
		System.out.printf("%d\n", count);
	}
}

Compiler output:
Main.java:21: error: ';' expected
			int small = arr[minj]
			                     ^
1 error
Language: Java

mport java.io.*;
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        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++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
         
    }
}

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

import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    }
    static int[] makeArray(int num){
        int[] arr = new int[num];
        for( int i = 0; i < num; i++){
            arr[i] = sc.nextInt();
        }
        return arr;
    } 
    static int minOf(int[] a, int start) {
        int index = start;
        int min = a[start];
        for(int i = start; i < a.length; i++) {
            if(a[i] < min) {
                min = a[i];
                index = i;
            }
        }
        return index;
    }
    static void swap(int[] a,int i, int j ){
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;    
    }
    
    public static void main(String[] args) {
        int N = sc.nextInt();
        int[] arr = makeArray(N);
        
        int index;
        int count = 0;
        for(int i = 0; i < N; i++) {
            index = minOf(arr,i);
            if(arr[index] != arr[i]) {
                swap(arr,i,index);
                count++;
            }
            
        }
        checkArray(arr);
        System.out.println(count);
    }
    

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

import java.util.Scanner;

public class bh {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]);
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	}
}

Compiler output:
Main.java:3: error: class bh is public, should be declared in a file named bh.java
public class bh {
       ^
1 error
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;


class Main {

	int count = 0;

	public static void main(String[] args) {

		InputOutput stdIO = new InputOutput();

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

		ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort();

		my.selectionSort(values, n);
		stdIO.outputLine(values);
		System.out.println(my.count);

		stdIO.close();
	}

	private void selectionSort(List<Integer> values, int n) {

		for (int i = 0; i < n - 1; i++) {
			int minj = values.get(i);
			int minindex = 0;
			for (int j = i; j < n; j++) {
				if (minj > values.get(j)) {
					minj = values.get(j);
					minindex = j;
				}
			}
			if(values.get(i) > minj) {
			values.set(minindex, values.get(i));
//			System.out.println(values);
			values.set(i, minj);
//			System.out.println(values);
			count++;
			}
//			System.out.println(count);
		}
	}
}

class InputOutput {
	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();
		}
	}

	public void outputLine(List<Integer> values) {
		StringBuilder line = new StringBuilder();
		for(int k = 0; k < values.size(); k++) {
			line.append(values.get(k) + " ");
		}
		System.out.println(line.delete(line.length()-1, line.length()));
	}
}

Compiler output:
Main.java:21: error: cannot find symbol
		ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort();
		^
  symbol:   class ALDS1_2_B_Selection_Sort
  location: class Main
Main.java:21: error: cannot find symbol
		ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort();
		                                  ^
  symbol:   class ALDS1_2_B_Selection_Sort
  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;

class Main {

	int count = 0;

	public static void main(String[] args) {

		InputOutput stdIO = new InputOutput();

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

		ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort();

		my.selectionSort(values, n);
		stdIO.outputLine(values);
		System.out.println(my.count);

		stdIO.close();
	}

	private void selectionSort(List<Integer> values, int n) {

		for (int i = 0; i < n - 1; i++) {
			int minj = values.get(i);
			int minindex = 0;
			for (int j = i; j < n; j++) {
				if (minj > values.get(j)) {
					minj = values.get(j);
					minindex = j;
				}
			}
			if(values.get(i) > minj) {
			values.set(minindex, values.get(i));
//			System.out.println(values);
			values.set(i, minj);
//			System.out.println(values);
			count++;
			}
//			System.out.println(count);
		}
	}
}

class InputOutput {
	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();
		}
	}

	public void outputLine(List<Integer> values) {
		StringBuilder line = new StringBuilder();
		for(int k = 0; k < values.size(); k++) {
			line.append(values.get(k) + " ");
		}
		System.out.println(line.delete(line.length()-1, line.length()));
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
		ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort();
		^
  symbol:   class ALDS1_2_B_Selection_Sort
  location: class Main
Main.java:20: error: cannot find symbol
		ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort();
		                                  ^
  symbol:   class ALDS1_2_B_Selection_Sort
  location: class Main
2 errors
Language: Java

import java.util.*;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String[] line = sc.nextLine().split(" ");
        int[] arr = new int[n];
        int temp;
        int count = 0;
        for(int x = 0; x < n; x++){
            arr[x] = Integer.parseInt(line[x]);
        }

        for(int i=0; i < n; i++){
            int min = i;
            for(int j = i+1; j < n; j++){
                if(arr[min] > arr[j]){
                    min = j;
                }
            }
            if(i != min){
                temp = arr[i];
                arr[i] = arr[min];
                arr[min] = temp;
                count++;
            }
        }
        for(int x = 0; x < n; x++){
            if(x == n-1){
                System.out.println(arr[x]);
            }else{
                System.out.print(arr[x]);
                System.out.print(" ");
            }
        }
        System.out.println(count);
        

    }

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

import java.util.*;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String[] line = sc.nextLine().split(" ");
        int[] arr = new int[n];
        int temp;
        int count = 0;
        for(int x = 0; x < n; x++){
            arr[x] = Integer.parseInt(line[x]);
        }

        for(int i=0; i < n; i++){
            int min = i;
            for(int j = i+1; j < n; j++){
                if(arr[min] > arr[j]){
                    min = j;
                }
            }
            if(i != min){
                temp = arr[i];
                arr[i] = arr[min];
                arr[min] = temp;
                count++;
            }
        }
        for(int x = 0; x < n; x++){
            if(x == n-1){
                System.out.println(arr[x]);
            }else{
                System.out.print(arr[x]);
                System.out.print(" ");
            }
        }
        System.out.println(count);
        

    }
???

Compiler output:
Main.java:41: error: illegal start of type
???
^
Main.java:41: error: reached end of file while parsing
???
   ^
2 errors
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  }
}



Compiler output:
Main.java:12: error: cannot find symbol
        for (j = i+1; j < n; j++) {
             ^
  symbol:   variable j
  location: class Main
Main.java:12: error: cannot find symbol
        for (j = i+1; j < n; j++) {
                      ^
  symbol:   variable j
  location: class Main
Main.java:12: error: cannot find symbol
        for (j = i+1; j < n; j++) {
                             ^
  symbol:   variable j
  location: class Main
Main.java:13: error: cannot find symbol
            if (N[j] < N[min]) {
                  ^
  symbol:   variable j
  location: class Main
Main.java:14: error: cannot find symbol
                min = j;
                      ^
  symbol:   variable j
  location: class Main
5 errors
Language: Java

import java.awt.datatransfer.FlavorEvent;
import java.util.Scanner;
import javax.sound.midi.SysexMessage;
  
public class Main{      
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.nextLine();
        String str2[] = str.split(" ");
        int ints[] = new int[n];
        int flag = 1;
        int count = 0;

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

        for(int i = 0;i<n-1;i++)
        {
            int minj=i;
            for(int j=i;j<n-1;j++)
                {
                    if(ints[j]<ints[minj])
                        minj=j;
                }
                if(minj!=j){
                    int ii = ints[i];
                    ints[i]=ints[minj];
                    ints[minj]=ii;
                    count++;
                }
            
        }

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


Compiler output:
Main.java:28: error: cannot find symbol
                if(minj!=j){
                         ^
  symbol:   variable j
  location: class Main
1 error
Language: Java

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

public class Contest {
	public static void main(String args[]) throws Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String ns = br.readLine();
		int n = Integer.parseInt(ns);

		String as = br.readLine();
		String[] as_ary = as.split(" ");

		int[] a_ary = new int[n];
		for (int i = 0; i < n; i++) {
			a_ary[i] = Integer.parseInt(as_ary[i]);
		}

		int minj;
		int min;
		int count = 0;
		for (int i = 0; i < n; i++) {
			minj = i;
			for (int j = i + 1; j < n; j++) {
				if (a_ary[j] < a_ary[minj]) {
					minj = j;
				}
			}

			if (i != minj) {
				count += 1;
				min = a_ary[minj];
				a_ary[minj] = a_ary[i];
				a_ary[i] = min;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.printf(a_ary[i] + (i != n - 1 ? " ": ""));
		}
		System.out.println("\n"+count);
	}
}


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

import java.util.Scanner;

public class _2_BSelectionSort {
    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 < a.length; i++) {
           a[i]=sc.nextInt();
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            int min = i;
            for (int j = i; j < a.length; j++) {
                if (a[j] < a[min]) {
                    min = j;
                }
            }
            int temp = a[min];
            a[min] = a[i];
            a[i] = temp;
            sum++;
        }
        for (int i = 0; i < a.length-1; i++) {
            System.out.print(a[i]+" ");
        }
        System.out.print(a[n-1]+"\n"+sum+"\n");
    }
}


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

import java.util.Scanner;

public class _2_BSelectionSort {
    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 < a.length; i++) {
            a[i] = sc.nextInt();
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            int min = i;
            for (int j = i; j < a.length; j++) {
                if (a[j] < a[min]) {
                    min = j;
                }
            }
            if (min != i) {
                int temp = a[min];
                a[min] = a[i];
                a[i] = temp;
                sum++;
            }
        }
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.print(a[n - 1] + "\n" + sum + "\n");
    }
}


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

#include <iostream>
using namespace std;
int selectionSort(int A[], int N){
    int i, j, s, tmp, minj;
    for(i=0; i<N-1; i++){
        minj = i;
        for(j=i; j<N; j++){
            if(A[j]<A[minj]) minj = j;
        }
        tmp = A[i];
        A[i] = A[minj];
        A[minj] = tmp;
        
        if(i != minj) s++;
    }
    return s;
}

int main(void){
    int N, s;
    int A[101];
    
    cin >> N;
    for(int i=0; i<N; i++) cin >> A[i];
    
    s = selectionSort(A, N);
    
    for(int i=0; i<N; i++){
        if(i>0) cout << " ";
        cout << A[i];
    }
    cout << endl;
    cout << s << endl;
    
    return 0;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
int selectionSort(int A[], int N){
^
  (use --enable-preview to enable unnamed classes)
Main.java:23: error: not a statement
    cin >> N;
        ^
Main.java:24: error: not a statement
    for(int i=0; i<N; i++) cin >> A[i];
                               ^
Main.java:29: error: not a statement
        if(i>0) cout << " ";
                     ^
Main.java:30: error: not a statement
        cout << A[i];
             ^
Main.java:32: error: not a statement
    cout << endl;
         ^
Main.java:33: error: not a statement
    cout << s << endl;
              ^
Main.java:19: error: <identifier> expected
int main(void){
             ^
Main.java:21: error: ']' expected
    int A[101];
          ^
11 errors
Language: Java

#include <stdio.h>
 int main(){
 int minj,i,j,n,tmp;
 int count=0;

 scanf("%d",&n);
 int A[n];

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

 for(i=0; i<=n-1; i++){
  minj = i;
    for(j=i; j<=n-1; 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(i=0; i<n; i++){
if(i!=n-1)printf("%d ",A[i]);
else {
  printf("%d\n",A[i]);
}
}
printf("%d\n",count);

return 0;
 }



Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
 int count=0;
 ^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: class, interface, enum, or record expected
 scanf("%d",&n);
 ^
Main.java:7: error: class, interface, enum, or record expected
 int A[n];
 ^
Main.java:9: error: class, interface, enum, or record expected
 for(i=0; i<n; i++)
 ^
Main.java:9: error: class, interface, enum, or record expected
 for(i=0; i<n; i++)
          ^
Main.java:9: error: class, interface, enum, or record expected
 for(i=0; i<n; i++)
               ^
Main.java:12: error: class, interface, enum, or record expected
 for(i=0; i<=n-1; i++){
 ^
Main.java:12: error: class, interface, enum, or record expected
 for(i=0; i<=n-1; i++){
          ^
Main.java:12: error: class, interface, enum, or record expected
 for(i=0; i<=n-1; i++){
                  ^
Main.java:14: error: class, interface, enum, or record expected
    for(j=i; j<=n-1; j++){
    ^
Main.java:14: error: class, interface, enum, or record expected
    for(j=i; j<=n-1; j++){
             ^
Main.java:14: error: class, interface, enum, or record expected
    for(j=i; j<=n-1; j++){
                     ^
Main.java:17: error: class, interface, enum, or record expected
      }
      ^
Main.java:22: error: class, interface, enum, or record expected
    A[i] = A[minj];
    ^
Main.java:23: error: class, interface, enum, or record expected
    A[minj] = tmp;
    ^
Main.java:24: error: class, interface, enum, or record expected
    count++;
    ^
Main.java:25: error: class, interface, enum, or record expected
}
^
Main.java:29: error: class, interface, enum, or record expected
for(i=0; i<n; i++){
         ^
Main.java:29: error: class, interface, enum, or record expected
for(i=0; i<n; i++){
              ^
Main.java:31: error: class, interface, enum, or record expected
else {
^
Main.java:33: error: class, interface, enum, or record expected
}
^
Main.java:37: error: class, interface, enum, or record expected
return 0;
^
Main.java:38: error: class, interface, enum, or record expected
 }
 ^
25 errors