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

#include<stdio.h>
int main(){
  
  int i,j,k,v,N;
  int a[1000];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  for(i=1;i<N;i++){
    v=a[i];
    j=i-1;
    while(j>=0 && a[j]>v){
      a[j+1]=a[j];
      j--;
      a[j+1]=v;
    }
    for(k=0;k<N;k++){
      printf("%d ",a[k]);
    }
    printf("\n");
  }
  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:5: error: class, interface, enum, or record expected
  int a[1000];
  ^
Main.java:7: error: class, interface, enum, or record expected
  scanf("%d",&N);
  ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
  ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
          ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
              ^
Main.java:10: error: class, interface, enum, or record expected
  }
  ^
Main.java:11: error: class, interface, enum, or record expected
  for(i=1;i<N;i++){
          ^
Main.java:11: error: class, interface, enum, or record expected
  for(i=1;i<N;i++){
              ^
Main.java:13: error: class, interface, enum, or record expected
    j=i-1;
    ^
Main.java:14: error: class, interface, enum, or record expected
    while(j>=0 && a[j]>v){
    ^
Main.java:16: error: class, interface, enum, or record expected
      j--;
      ^
Main.java:17: error: class, interface, enum, or record expected
      a[j+1]=v;
      ^
Main.java:18: error: class, interface, enum, or record expected
    }
    ^
Main.java:19: error: class, interface, enum, or record expected
    for(k=0;k<N;k++){
            ^
Main.java:19: error: class, interface, enum, or record expected
    for(k=0;k<N;k++){
                ^
Main.java:21: error: class, interface, enum, or record expected
    }
    ^
Main.java:23: error: class, interface, enum, or record expected
  }
  ^
Main.java:25: error: class, interface, enum, or record expected
}
^
20 errors
Language: Java

import java.util.Scanner;

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

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

  print(array);
  for (int i = 1; i < array.length; i++) {
      int key = array[i];
      int j = i - 1;
      while (j >= 0 && array[j] > key) {
          array[j+1] = array[j];
          j--;
      }
      array[j+1] = key;
      print(array);
  }

}

public static void print(int[] array) {
  for (int i = 0 ; i < array.length - 1; i++) {
      System.out.print(array[i] + " ");
  }
  System.out.println(array[array.length-1]);
}


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

import java.util.*;
public class A{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Sort sort = new Sort();
		int n = scanner.nextInt();
		int[] a=new int[n];
		int i=0;
		while(i<n){
			a[i]=scanner.nextInt();
			i++;
		}
		sort.insertionSort(a, n);

	}
}

class Sort{
	public Sort(){}
	public void insertionSort(int[] a, int n){
		for(int i=1;i<a.length;i++){
			int v=a[i];
			int j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
				j--;
			}
			a[j+1]=v;
			printing(a);
		}
	}
	public void printing(int[] a){
		for(int i=0;i<a.length;i++){
			System.out.print(a[i]+" ");
		}
		System.out.println();
	}
}


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

import java.util.*;
public class A{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Sort sort = new Sort();
		int n = scanner.nextInt();
		int[] a=new int[n];
		int i=0;
		while(i<n){
			a[i]=scanner.nextInt();
			i++;
		}
		sort.insertionSort(a, n);

	}
}

class Sort{
	public Sort(){}
	public void insertionSort(int[] a, int n){
		for(int i=1;i<a.length;i++){
			int v=a[i];
			int j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
				j--;
			}
			a[j+1]=v;
			printing(a);
		}
	}
	public void printing(int[] a){
		for(int i=0;i<a.length;i++){
			System.out.print(a[i]+" ");
		}
		System.out.println();
	}
}



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

#include<stdio.h>


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


void insertionSort(int A[], int n){
  int j,i,v;
  for(i = 1;i < n;i++){
    v = A[i];
    j = i - 1;
    while(j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;

    }
    A[j + 1] = v;
    output(A, n);
    }
  }

int main(){

  int i,n,j;
  int A[100];

  scanf("%d",&n);
  for(i = 0;i < n;i++){
    scanf("%d",&A[i]);
  }
  output(A , n);
  insertionSort(A , n);
  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:6: error: class, interface, enum, or record expected
  for(i =0;i<n;i++){
  ^
Main.java:6: error: class, interface, enum, or record expected
  for(i =0;i<n;i++){
           ^
Main.java:6: error: class, interface, enum, or record expected
  for(i =0;i<n;i++){
               ^
Main.java:9: error: class, interface, enum, or record expected
    }
    ^
Main.java:11: error: class, interface, enum, or record expected
  }
  ^
Main.java:13: error: class, interface, enum, or record expected
}
^
Main.java:18: error: class, interface, enum, or record expected
  for(i = 1;i < n;i++){
  ^
Main.java:18: error: class, interface, enum, or record expected
  for(i = 1;i < n;i++){
            ^
Main.java:18: error: class, interface, enum, or record expected
  for(i = 1;i < n;i++){
                  ^
Main.java:20: error: class, interface, enum, or record expected
    j = i - 1;
    ^
Main.java:21: error: class, interface, enum, or record expected
    while(j >= 0 && A[j] > v){
    ^
Main.java:23: error: class, interface, enum, or record expected
      j--;
      ^
Main.java:25: error: class, interface, enum, or record expected
    }
    ^
Main.java:27: error: class, interface, enum, or record expected
    output(A, n);
    ^
Main.java:28: error: class, interface, enum, or record expected
    }
    ^
Main.java:34: error: class, interface, enum, or record expected
  int A[100];
  ^
Main.java:36: error: class, interface, enum, or record expected
  scanf("%d",&n);
  ^
Main.java:37: error: class, interface, enum, or record expected
  for(i = 0;i < n;i++){
  ^
Main.java:37: error: class, interface, enum, or record expected
  for(i = 0;i < n;i++){
            ^
Main.java:37: error: class, interface, enum, or record expected
  for(i = 0;i < n;i++){
                  ^
Main.java:39: error: class, interface, enum, or record expected
  }
  ^
Main.java:41: error: class, interface, enum, or record expected
  insertionSort(A , n);
  ^
Main.java:42: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:43: error: class, interface, enum, or record expected
}
^
26 errors
Language: Java

#include<stdio.h>
int main(){
  int l[100];
  int i;
  int temp;
  int j;
  int number;
  int k;
  scanf("%d",&number);
  for(i=0;i<number;i++){
    scanf("%d",&l[i]);
  }
  for(i=0;i<number-1;i++){
    printf("%d ",l[i]);
  }
  printf("%d\n",l[number-1]);
  for(i=1;i<number;i++){
    temp=l[i];
    j=i-1;
    while(j>=0&&l[j]>temp){
      l[j+1]=l[j];
      j=j-1;
    }
      l[j+1]=temp;
    for(k=0;k<number-1;k++){
      printf("%d ",l[k]);
    }
    printf("%d\n",l[number-1]);
  }
  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 i;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
  scanf("%d",&number);
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0;i<number;i++){
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0;i<number;i++){
          ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0;i<number;i++){
                   ^
Main.java:12: error: class, interface, enum, or record expected
  }
  ^
Main.java:13: error: class, interface, enum, or record expected
  for(i=0;i<number-1;i++){
          ^
Main.java:13: error: class, interface, enum, or record expected
  for(i=0;i<number-1;i++){
                     ^
Main.java:15: error: class, interface, enum, or record expected
  }
  ^
Main.java:17: error: class, interface, enum, or record expected
  for(i=1;i<number;i++){
  ^
Main.java:17: error: class, interface, enum, or record expected
  for(i=1;i<number;i++){
          ^
Main.java:17: error: class, interface, enum, or record expected
  for(i=1;i<number;i++){
                   ^
Main.java:19: error: class, interface, enum, or record expected
    j=i-1;
    ^
Main.java:20: error: class, interface, enum, or record expected
    while(j>=0&&l[j]>temp){
    ^
Main.java:22: error: class, interface, enum, or record expected
      j=j-1;
      ^
Main.java:23: error: class, interface, enum, or record expected
    }
    ^
Main.java:25: error: class, interface, enum, or record expected
    for(k=0;k<number-1;k++){
    ^
Main.java:25: error: class, interface, enum, or record expected
    for(k=0;k<number-1;k++){
            ^
Main.java:25: error: class, interface, enum, or record expected
    for(k=0;k<number-1;k++){
                       ^
Main.java:27: error: class, interface, enum, or record expected
    }
    ^
Main.java:29: error: class, interface, enum, or record expected
  }
  ^
Main.java:31: error: class, interface, enum, or record expected
}
^
24 errors
Language: Java

#include <stdio.h>

int main(){
  int A[100]={0};
  int k=0,i=0,j=0,v=0,a,c=0,size;
  scanf("%d",&size);
  for(c=0;c<size;c++){
  scanf("%d",&a);
    A[c]=a;
    }

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

  for(i=1;i<=c-1;i++){
    v = A[i];
    j = i - 1;
    while(j>=0 && A[j] > v){
      A[j+1] = A[j];
      j--;
      A[j+1] = v;
    }
  for(k=0;k<c-1;k++){
    printf("%d ",A[k]);
  }
  printf("%d",A[k]);
  printf("\n");
  }
  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:5: error: unnamed classes are a preview feature and are disabled by default.
  int k=0,i=0,j=0,v=0,a,c=0,size;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: class, interface, enum, or record expected
  scanf("%d",&size);
  ^
Main.java:7: error: class, interface, enum, or record expected
  for(c=0;c<size;c++){
  ^
Main.java:7: error: class, interface, enum, or record expected
  for(c=0;c<size;c++){
          ^
Main.java:7: error: class, interface, enum, or record expected
  for(c=0;c<size;c++){
                 ^
Main.java:9: error: class, interface, enum, or record expected
    A[c]=a;
    ^
Main.java:10: error: class, interface, enum, or record expected
    }
    ^
Main.java:12: error: class, interface, enum, or record expected
  for(k=0;k<c;k++){
          ^
Main.java:12: error: class, interface, enum, or record expected
  for(k=0;k<c;k++){
              ^
Main.java:14: error: class, interface, enum, or record expected
  }
  ^
Main.java:18: error: class, interface, enum, or record expected
  for(i=1;i<=c-1;i++){
  ^
Main.java:18: error: class, interface, enum, or record expected
  for(i=1;i<=c-1;i++){
          ^
Main.java:18: error: class, interface, enum, or record expected
  for(i=1;i<=c-1;i++){
                 ^
Main.java:20: error: class, interface, enum, or record expected
    j = i - 1;
    ^
Main.java:21: error: class, interface, enum, or record expected
    while(j>=0 && A[j] > v){
    ^
Main.java:23: error: class, interface, enum, or record expected
      j--;
      ^
Main.java:24: error: class, interface, enum, or record expected
      A[j+1] = v;
      ^
Main.java:25: error: class, interface, enum, or record expected
    }
    ^
Main.java:26: error: class, interface, enum, or record expected
  for(k=0;k<c-1;k++){
          ^
Main.java:26: error: class, interface, enum, or record expected
  for(k=0;k<c-1;k++){
                ^
Main.java:28: error: class, interface, enum, or record expected
  }
  ^
Main.java:30: error: class, interface, enum, or record expected
  printf("\n");
  ^
Main.java:31: error: class, interface, enum, or record expected
  }
  ^
Main.java:33: error: class, interface, enum, or record expected
}
^
26 errors
Language: Java

#include<stdio.h>
int main(){
  
  int i,j,k,v,N;
  int a[1000];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<N;i++){
      printf("%d ",a[i]);
  }
  printf("\n");
  for(i=1;i<N;i++){
    v=a[i];
    j=i-1;
    while(j>=0 && a[j]>v){
      a[j+1]=a[j];
      j--;
      a[j+1]=v;
    }
    for(k=0;k<N;k++){
      printf("%d ",a[k]);
    }
    printf("\n");
  }
  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:5: error: class, interface, enum, or record expected
  int a[1000];
  ^
Main.java:7: error: class, interface, enum, or record expected
  scanf("%d",&N);
  ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
  ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
          ^
Main.java:8: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
              ^
Main.java:10: error: class, interface, enum, or record expected
  }
  ^
Main.java:11: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
          ^
Main.java:11: error: class, interface, enum, or record expected
  for(i=0;i<N;i++){
              ^
Main.java:13: error: class, interface, enum, or record expected
  }
  ^
Main.java:15: error: class, interface, enum, or record expected
  for(i=1;i<N;i++){
  ^
Main.java:15: error: class, interface, enum, or record expected
  for(i=1;i<N;i++){
          ^
Main.java:15: error: class, interface, enum, or record expected
  for(i=1;i<N;i++){
              ^
Main.java:17: error: class, interface, enum, or record expected
    j=i-1;
    ^
Main.java:18: error: class, interface, enum, or record expected
    while(j>=0 && a[j]>v){
    ^
Main.java:20: error: class, interface, enum, or record expected
      j--;
      ^
Main.java:21: error: class, interface, enum, or record expected
      a[j+1]=v;
      ^
Main.java:22: error: class, interface, enum, or record expected
    }
    ^
Main.java:23: error: class, interface, enum, or record expected
    for(k=0;k<N;k++){
            ^
Main.java:23: error: class, interface, enum, or record expected
    for(k=0;k<N;k++){
                ^
Main.java:25: error: class, interface, enum, or record expected
    }
    ^
Main.java:27: error: class, interface, enum, or record expected
  }
  ^
Main.java:29: error: class, interface, enum, or record expected
}
^
24 errors
Language: Java

#include<stdio.h>
#include<stdlib.h>

int main(){
  int i = 0;
  int data = 0;
  int V = 0;
  int j = 0;
  int *insert;

  scanf("%d",&data);
  insert = (int *)malloc(sizeof(int));
for(i = 0 ; i++ ; i < data){
scanf("%d",insert[i]);
}

for(i = 1; i++ ; i <= data-1){
  V = insert[i];
  j = i - 1;

  while(j >= 0 && insert[j] > V){
    insert[j + 1] = insert[j];
    j--;
    insert[j + 1] = V;
  }
}
for(i = 1 ; i++ ; i < data){
  printf(" %d ",&insert[i]);
}
printf("\n");
}



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:2: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
  int data = 0;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
  int *insert;
  ^
Main.java:11: error: class, interface, enum, or record expected
  scanf("%d",&data);
  ^
Main.java:12: error: class, interface, enum, or record expected
  insert = (int *)malloc(sizeof(int));
  ^
Main.java:13: error: class, interface, enum, or record expected
for(i = 0 ; i++ ; i < data){
^
Main.java:13: error: class, interface, enum, or record expected
for(i = 0 ; i++ ; i < data){
            ^
Main.java:13: error: class, interface, enum, or record expected
for(i = 0 ; i++ ; i < data){
                  ^
Main.java:15: error: class, interface, enum, or record expected
}
^
Main.java:17: error: class, interface, enum, or record expected
for(i = 1; i++ ; i <= data-1){
           ^
Main.java:17: error: class, interface, enum, or record expected
for(i = 1; i++ ; i <= data-1){
                 ^
Main.java:19: error: class, interface, enum, or record expected
  j = i - 1;
  ^
Main.java:21: error: class, interface, enum, or record expected
  while(j >= 0 && insert[j] > V){
  ^
Main.java:23: error: class, interface, enum, or record expected
    j--;
    ^
Main.java:24: error: class, interface, enum, or record expected
    insert[j + 1] = V;
    ^
Main.java:25: error: class, interface, enum, or record expected
  }
  ^
Main.java:27: error: class, interface, enum, or record expected
for(i = 1 ; i++ ; i < data){
            ^
Main.java:27: error: class, interface, enum, or record expected
for(i = 1 ; i++ ; i < data){
                  ^
Main.java:29: error: class, interface, enum, or record expected
}
^
Main.java:31: error: class, interface, enum, or record expected
}
^
22 errors
Language: Java

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define A 1000
int main(){
  int i,j,k,n;
  int *a;
  int key;
  scanf("%d",&n);
  a = (int *)malloc(sizeof(int)*n);
  for(i = 0;i <= n-1; i++){
    scanf("%d",&a[i]); 
  }
  for(i=1;i <= n-1; i++){
    key = a[i];
    j = i-1;
    while(j >= 0 && a[j] > key){
      a[j+1]=a[j];
      j--;
    }
    a[j+1]=key;
    for(k=0;k<=n-1;k++){
      printf("%d ",a[k]);
    }
    printf("\n");
  }
  
  free(a);

  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:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:3: error: illegal character: '#'
#define N 100
^
Main.java:4: error: illegal character: '#'
#define A 1000
^
Main.java:7: error: class, interface, enum, or record expected
  int *a;
  ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
  int key;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
  scanf("%d",&n);
  ^
Main.java:10: error: class, interface, enum, or record expected
  a = (int *)malloc(sizeof(int)*n);
  ^
Main.java:11: error: class, interface, enum, or record expected
  for(i = 0;i <= n-1; i++){
  ^
Main.java:11: error: class, interface, enum, or record expected
  for(i = 0;i <= n-1; i++){
            ^
Main.java:11: error: class, interface, enum, or record expected
  for(i = 0;i <= n-1; i++){
                      ^
Main.java:13: error: class, interface, enum, or record expected
  }
  ^
Main.java:14: error: class, interface, enum, or record expected
  for(i=1;i <= n-1; i++){
          ^
Main.java:14: error: class, interface, enum, or record expected
  for(i=1;i <= n-1; i++){
                    ^
Main.java:16: error: class, interface, enum, or record expected
    j = i-1;
    ^
Main.java:17: error: class, interface, enum, or record expected
    while(j >= 0 && a[j] > key){
    ^
Main.java:19: error: class, interface, enum, or record expected
      j--;
      ^
Main.java:20: error: class, interface, enum, or record expected
    }
    ^
Main.java:22: error: class, interface, enum, or record expected
    for(k=0;k<=n-1;k++){
    ^
Main.java:22: error: class, interface, enum, or record expected
    for(k=0;k<=n-1;k++){
            ^
Main.java:22: error: class, interface, enum, or record expected
    for(k=0;k<=n-1;k++){
                   ^
Main.java:24: error: class, interface, enum, or record expected
    }
    ^
Main.java:26: error: class, interface, enum, or record expected
  }
  ^
Main.java:30: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:32: error: class, interface, enum, or record expected
}
^
26 errors
Language: Java

#include <stdio.h>
#include <stdlib.h>

int main(){
  int a[5],b;
  int i,j,k,num,v;

  scanf("%d",&num);
 for(i=0; i<num; i++){
   scanf("%d",&a[i]);
 }

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

   v = a[i];
   b = i - 1;

   while(b>=0 && a[b] > v){
     a[b+1] = a[b];
     b--;
     a[b+1] =v;
   }
   for(k=0; k<num; k++){
     printf("%d ",a[k]);
   }
 printf("\n");
}

}



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:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:6: error: class, interface, enum, or record expected
  int i,j,k,num,v;
  ^
Main.java:8: error: class, interface, enum, or record expected
  scanf("%d",&num);
  ^
Main.java:9: error: class, interface, enum, or record expected
 for(i=0; i<num; i++){
 ^
Main.java:9: error: class, interface, enum, or record expected
 for(i=0; i<num; i++){
          ^
Main.java:9: error: class, interface, enum, or record expected
 for(i=0; i<num; i++){
                 ^
Main.java:11: error: class, interface, enum, or record expected
 }
 ^
Main.java:13: error: class, interface, enum, or record expected
 for(i=0; i<num; i++){
          ^
Main.java:13: error: class, interface, enum, or record expected
 for(i=0; i<num; i++){
                 ^
Main.java:16: error: class, interface, enum, or record expected
   b = i - 1;
   ^
Main.java:18: error: class, interface, enum, or record expected
   while(b>=0 && a[b] > v){
   ^
Main.java:20: error: class, interface, enum, or record expected
     b--;
     ^
Main.java:21: error: class, interface, enum, or record expected
     a[b+1] =v;
     ^
Main.java:22: error: class, interface, enum, or record expected
   }
   ^
Main.java:23: error: class, interface, enum, or record expected
   for(k=0; k<num; k++){
            ^
Main.java:23: error: class, interface, enum, or record expected
   for(k=0; k<num; k++){
                   ^
Main.java:25: error: class, interface, enum, or record expected
   }
   ^
Main.java:27: error: class, interface, enum, or record expected
}
^
20 errors
Language: Java

N = int(input())
arr = [int(n) for n in input().split()]

print(' '.join(map(str, arr)))
for i in range(1, N):
    v = arr[i]
    j = i - 1
    while(j >= 0 and arr[j] > v):
        arr[j + 1] = arr[j]
        j -= 1
    arr[j + 1] = v
    print(' '.join(map(str, arr)))



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
N = int(input())
^
1 error
Language: Java

#include<stdio.h>
int main(){
    int i,j,n,v,k;
    int A[10];
    scanf("%d",&n);

    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
   
    for(i=1;i<=n-1;i++){
        v = A[i];
        j=i-1;
        while(j>=0 && A[j]>v){
            A[j+1] = A[j];
            j--;
        }
            A[j+1] = v;

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

}


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: class, interface, enum, or record expected
    int A[10];
    ^
Main.java:5: error: class, interface, enum, or record expected
    scanf("%d",&n);
    ^
Main.java:7: error: class, interface, enum, or record expected
    for(i=0;i<n;i++){
    ^
Main.java:7: error: class, interface, enum, or record expected
    for(i=0;i<n;i++){
            ^
Main.java:7: error: class, interface, enum, or record expected
    for(i=0;i<n;i++){
                ^
Main.java:9: error: class, interface, enum, or record expected
        if(i>0)printf(" ");
        ^
Main.java:10: error: class, interface, enum, or record expected
        printf("%d",A[i]);
        ^
Main.java:11: error: class, interface, enum, or record expected
    }
    ^
Main.java:14: error: class, interface, enum, or record expected
    for(i=1;i<=n-1;i++){
    ^
Main.java:14: error: class, interface, enum, or record expected
    for(i=1;i<=n-1;i++){
            ^
Main.java:14: error: class, interface, enum, or record expected
    for(i=1;i<=n-1;i++){
                   ^
Main.java:16: error: class, interface, enum, or record expected
        j=i-1;
        ^
Main.java:17: error: class, interface, enum, or record expected
        while(j>=0 && A[j]>v){
        ^
Main.java:19: error: class, interface, enum, or record expected
            j--;
            ^
Main.java:20: error: class, interface, enum, or record expected
        }
        ^
Main.java:23: error: class, interface, enum, or record expected
            for(k=0;k<n;k++){
            ^
Main.java:23: error: class, interface, enum, or record expected
            for(k=0;k<n;k++){
                    ^
Main.java:23: error: class, interface, enum, or record expected
            for(k=0;k<n;k++){
                        ^
Main.java:25: error: class, interface, enum, or record expected
            printf("%d", A[k]);
            ^
Main.java:26: error: class, interface, enum, or record expected
            }
            ^
Main.java:28: error: class, interface, enum, or record expected
    }
    ^
23 errors
Language: Java

package Lecture1;
import java.util.Scanner;
public class Ex1 {
	Scanner sc = new Scanner(System.in);
	int N;	//要素数
	int v=0;	//保存用変数
	int j=0;	//添字のための変数
	int[] A;
	
	public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	}
	
	//ソート部分
	public void conpute() {
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	}
	
	public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Ex1 obj = new Ex1();
		obj.input();
		obj.conpute();
	}
}



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

import java.util.Scanner;
public class A {
public static void main(String args[])
{
	Scanner s = new Scanner(System.in);
	int a = s.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = s.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];

		System.out.println("");
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		}

	}
}



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

import java.util.Scanner;
public class A{
private static Scanner s;

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

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];

		System.out.println("");
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		}

	}
}



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

import java.util.Scanner;

public class InsertionSort {
    public static void main(String[] args){
        int i,j,v;
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int A[] = new int[n];

        //Initialize data
        for(i=0; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        }
        //sort
        for(i = 1 ; i<n ; i++){
            v = A[i];
            j = i-1;
            while(j>=0 && A[j]>v){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            for(int k=0; k<n ; k++){
                System.out.print(A[k] + " ");
            }
            System.out.print("\n");
        }
    }
}



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

import java.util.Scanner;
public class A{

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

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];

		System.out.println("");
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		}

	}
}



Compiler output:
Main.java:2: error: class A is public, should be declared in a file named A.java
public class A{
       ^
Main.java:6: error: incompatible types: Scanner cannot be converted to int
	int s = new Scanner(System.in);
	        ^
Main.java:7: error: int cannot be dereferenced
	int a = s.nextInt();
	         ^
Main.java:10: error: int cannot be dereferenced
		b[i] = s.nextInt();
		        ^
4 errors
Language: Java

import java.util.Scanner;
public class A{

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

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];

		System.out.println("");
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		}

	}
}



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

import java.util.Scanner;
public class A{

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

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];

		System.out.println("");
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		}

	}
}



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

import java.util.Scanner;
public class A{

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

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];

		System.out.println("");
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		}

	}
}


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

import java.util.*;

/**
 * A
 */
public class A {
    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();
        }

        sc.close();

        for(int i=1; i<array.length; i++) {
            
            int key = array[i];
            /* insert A[i] into the sorted sequence A[0,...,j-1] */
            int j = i-1;
            while(j>=0 && array[j]>key) {
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = key;

            for(int num : array) {
                System.out.print(num+" ");
            }
            System.err.println();

        }

    }
}


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

import java.util.*;

/**
 * A
 */
public class A {
    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();
        }

        sc.close();

        for(int i=1; i<array.length; i++) {
            
            int key = array[i];
            /* insert A[i] into the sorted sequence A[0,...,j-1] */
            int j = i-1;
            while(j>=0 && array[j]>key) {
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = key;

            for(int num : array) {
                System.out.print(num+" ");
            }
            System.out.println();

        }

    }
}


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

import java.util.*;

/**
 * A
 */
public class A {
    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();
            System.out.print(array[i]);
            if(i!=n-1) {
                System.out.print(" ");
            }
        }

        System.out.println();

        sc.close();

        for(int i=1; i<array.length; i++) {
            
            int key = array[i];
            /* insert A[i] into the sorted sequence A[0,...,j-1] */
            int j = i-1;
            while(j>=0 && array[j]>key) {
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = key;

            for(int num=0; num<array.length; num++) {
                System.out.print(array[num]);
                if(num != array.length-1) {
                    System.out.print(" ");
                }
            }
            if(i != array.length-1) {
                System.out.println();
            }
        }

    }
}


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

import java.util.*;

/**
 * A
 */
public class A {
    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();
            System.out.print(array[i]);
            if(i<array.length-1) {
                System.out.print(" ");
            }
        }

        System.out.println();

        sc.close();

        for(int i=1; i<array.length; i++) {
            
            int key = array[i];
            /* insert A[i] into the sorted sequence A[0,...,j-1] */
            int j = i-1;
            while(j>=0 && array[j]>key) {
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = key;

            for(int num=0; num<array.length; num++) {
                System.out.print(array[num]);
                if(num != array.length-1) {
                    System.out.print(" ");
                } else {
                    System.out.println();
                }
            }
        }

    }
}


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

import java.util.Scanner;
public class A{
    private static Scanner scanner;
    public static void main(String args[])
    {
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++){
	    b[i] = scanner.nextInt();
	}
	for(int i = 1;i <= a;i++){
	    int v = b[i];
	    int j = i-1;
	    while(j >= 0 && b[j] > v){
		b[j+1] = b[j];
		j--;
		b[j+1] = v;
	    }
	    for(int c = 0;c < a;c++){
		System.out.print(b[c]);
		if(c != a-1) System.out.print(" ");
	    }
	    System.out.println("");
	}
    }
}



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

import java.util.Scanner;
public class Sort {

	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
				int n=x.nextInt();
		int[] a = new int [n];
		for(int i=0;i<a.length;i++) {
			a[i] = x.nextInt();
			System.out.print(a[i]);
			if(i < a.length -1) {
				System.out.print(" ");
			}
		}
		System.out.println();

		for(int i=1;i<a.length;i++) {
			int v = a[i];
			int j = i - 1;
			while( (j >= 0) && a[j] > v) {
				a[j+1] = a[j];
				j--;
				a[j+1] = v;
			}

			for(int k=0;k<a.length;k++) {
				System.out.print(a[k]);
				if(k < a.length - 1) {
					System.out.print(" ");
				}
				if(k >= a.length - 1) {
					System.out.println();
				}
			}
		}





	}

}



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

import java.util.Scanner;
class Sort {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
				int n=x.nextInt();
		int[] a = new int [n];
		for(int i=0;i<a.length;i++) {
			a[i] = x.nextInt();
			System.out.print(a[i]);
			if(i < a.length -1) {
				System.out.print(" ");
			}}
		System.out.println();
		for(int i=1;i<a.length;i++) {
			int v = a[i];
			int j = i - 1;
			while( (j >= 0) && a[j] > v) {
				a[j+1] = a[j];
				j--;
				a[j+1] = v;	}
			for(int k=0;k<a.length;k++) {
				System.out.print(a[k]);
				if(k < a.length - 1) {
					System.out.print(" ");	}
				if(k = a.length - 1) {
					System.out.println();
				}}}}}



Compiler output:
Main.java:25: error: incompatible types: int cannot be converted to boolean
				if(k = a.length - 1) {
				     ^
1 error
Language: Java

import java.util.Scanner;
public class Sort {

	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
				int n=x.nextInt();
		int[] a = new int [n];
		for(int i=0;i<a.length;i++) {
			a[i] = x.nextInt();
			System.out.print(a[i]);
			if(i < a.length -1) {
				System.out.print(" ");
			}
		}
		System.out.println();

		for(int i=1;i<a.length;i++) {
			int v = a[i];
			int j = i - 1;
			while( (j >= 0) && a[j] > v) {
				a[j+1] = a[j];
				j--;
				a[j+1] = v;
			}

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




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

import java.util.Scanner;
public class Sort {

	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
				int n=x.nextInt();
		int[] a = new int [n];
		for(int i=0;i<a.length;i++) {
			a[i] = x.nextInt();
			System.out.print(a[i]);
			if(i < a.length -1) {
				System.out.print(" ");
			}
		}
		System.out.println();

		for(int i=1;i<a.length;i++) {
			int v = a[i];
			int j = i - 1;
			while( (j >= 0) && a[j] > v) {
				a[j+1] = a[j];
				j--;
				a[j+1] = v;
			}

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



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

����5E
	

	"
#$%
#&'(<init>()VCodeLineNumberTablemain([Ljava/lang/String;)V
StackMapTable)*
SourceFile	Main.java
java/util/Scanner+,-
./012BootstrapMethods3456789:9Mainjava/lang/Object[Ljava/lang/String;[Ijava/lang/SysteminLjava/io/InputStream;(Ljava/io/InputStream;)VnextInt()IoutLjava/io/PrintStream;
;< makeConcatWithConstants(I)Ljava/lang/String;java/io/PrintStreamprint(Ljava/lang/String;)Vprintln=5A$java/lang/invoke/StringConcatFactoryCLookupInnerClasses�(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;D%java/lang/invoke/MethodHandles$Lookupjava/lang/invoke/MethodHandles!
*��	:	��Y��L+�=�
N�Y��:6�-�O����6d�a-.6d6�$-.�-`-.O��-`O���6��-.������	�
�����R 	)
2	8C
IO]gju~����.�#���%���
@
>B? !


Compiler output:
Main.java:1: error: illegal character: '\ufffd'
????5E
^
Main.java:1: error: illegal character: '\ufffd'
????5E
 ^
Main.java:1: error: illegal character: '\ufffd'
????5E
  ^
Main.java:1: error: illegal character: '\ufffd'
????5E
   ^
Main.java:1: error: illegal character: '\u0000'
????5E
    ^
Main.java:1: error: illegal character: '\u0000'
????5E
     ^
Main.java:1: error: illegal character: '\u0000'
????5E
      ^
Main.java:1: error: illegal character: '\u0000'
????5E
        ^
Main.java:2: error: illegal character: '\u0000'
	
^
Main.java:2: error: illegal character: '\u0000'
	
  ^
Main.java:2: error: illegal character: '\u0018'
	
   ^
Main.java:2: error: illegal character: '\u0007'
	
    ^
Main.java:2: error: illegal character: '\u0000'
	
     ^
Main.java:2: error: illegal character: '\u0019'
	
      ^
Main.java:2: error: illegal character: '\u0000'
	
       	^
Main.java:2: error: reached end of file while parsing
	
       	 ^
16 errors
Language: Java

import java.util.*;

public class A{
    public static void main(String[] args){
        Scanner n = new Scanner(System.in);
        int N = n.nextInt();
        int A[] = new int[N];
        Scanner a = new Scanner(System.in);
        for(int i=0; i < N; i++){
            A[i] = a.nextInt();
        }
        for(int i = 1; i < N ; i++){
            int v = A[i];
            int j = i - 1;
            while(j >= 0 && A[j] > v){
                A[j+1] = A[j];
                j--;
                A[j+1] = v;
            }
            for(int k=0; k<N; k++){
                System.out.print(A[k] + " ");
            }
            System.out.println("");
        }
    }
}


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

import java.util.*;

public class A{
    public static void main(String[] args){
        Scanner n = new Scanner(System.in);
        int N = n.nextInt();
        int A[] = new int[N];
        for(int i=0; i < N; i++){
            A[i] = n.nextInt();
        }
        for(int i = 1; i < N ; i++){
            int v = A[i];
            int j = i - 1;
            while(j >= 0 && A[j] > v){
                A[j+1] = A[j];
                j--;
                A[j+1] = v;
            }
            for(int k=0; k<N; k++){
                System.out.print(A[k] + " ");
            }
            System.out.println("");
        }
    }
}


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

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner n = new Scanner(System.in);
        int N = n.nextInt();
        int A[] = new int[N];
        for(int i=0; i < N; i++){
            A[i] = n.nextInt();
        }
        for(int i = 1; i <= N-1 ; i++){
            int v = A[i];
            int j = i - 1;
            while(j >= 0 && A[j] > v){
                A[j+1] = A[j];
                j--;
                A[j+1] = v;
            }
            for(int k=0; k<N; k++){
                System.out.print(A[k]);
                if(k == N){
                    System.out.println();
                }
                else if{
                    System.out.print(" ");
                }
            }
        }
    }
}


Compiler output:
Main.java:24: error: '(' expected
                else if{
                       ^
1 error
Language: Java

import java.util.*;

public class A{
    public static void main(String[] args){
        Scanner n = new Scanner(System.in);
        int N = n.nextInt();
        int A[] = new int[N];
        for(int i=0; i < N; i++){
            A[i] = n.nextInt();
        }
        for(int i=0; i < N; i++){
            System.out.print(A[i]);
            if(i==N-1){
                System.out.println("");
            }
            else{
                System.out.print(" ");
            }
        }
        for(int i = 1; i <= N-1 ; i++){
            int v = A[i];
            int j = i - 1;
            while(j >= 0 && A[j] > v){
                A[j+1] = A[j];
                j--;
                A[j+1] = v;
            }
            for(int k=0; k<N; k++){
                System.out.print(A[k]);
                if(k == N-1){
                    System.out.println("");
                }
                else{
                    System.out.print(" ");
                }
            }
        }
    }
}


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

package c;
import java.util.Scanner;
public class A {

	public static void main(String[] args) {
		int i, N, v, j, b, A[] = new int[1000];
		Scanner sc = new Scanner(System.in);
		while(true) {
			N = sc.nextInt();
			if(N<101 && N>0) {
				break;
			}
			System.out.println("Error\n");
		}
		
		for(i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		for(i=0; i<N; i++) {
			for(b=0; b<N-1; b++) {
				System.out.print(A[b] + " ");
			}
			System.out.println(A[N-1]);
			v=A[i];
			j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
		}
		
		for(i=0; i<N-1; i++) {
			System.out.print(A[i]+" ");
		}
		System.out.println(A[N-1]);

	}

}



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

import java.util.Scanner;
public class A {

	public static void main(String[] args) {
		int i, N, v, j, b, A[] = new int[1000];
		Scanner sc = new Scanner(System.in);
		while(true) {
			N = sc.nextInt();
			if(N<101 && N>0) {
				break;
			}
			System.out.println("Error\n");
		}
		
		for(i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		for(i=0; i<N; i++) {
			for(b=0; b<N-1; b++) {
				System.out.print(A[b] + " ");
			}
			System.out.println(A[N-1]);
			v=A[i];
			j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
		}
		
		for(i=0; i<N-1; i++) {
			System.out.print(A[i]+" ");
		}
		System.out.println(A[N-1]);

	}

}



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