Language: C++

import java.util.*;

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

                for(int i=1; i<N; i++){
                        int key = A[i];
                        int j = i-1;
                        System.out.println(Arrays.toString(A));
                        while(j>=0 && A[j]>key){
                                A[j+1] = A[j];
                                j--;
                        }
                        A[j+1] = key;
                }
                System.out.println(Arrays.toString(A));
        }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:4:42: error: expected ',' or '...' before 'args'
    4 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:24:2: error: expected ';' after class definition
   24 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'Scanner' was not declared in this scope
    5 |                 Scanner scanner = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:6:25: error: 'scanner' was not declared in this scope
    6 |                 int N = scanner.nextInt();
      |                         ^~~~~~~
a.cc:7:20: error: structured binding declaration cannot have type 'int'
    7 |                 int[] A = new int[N];
      |                    ^~
a.cc:7:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:20: error: empty structured binding declaration
a.cc:7:23: error: expected initializer before 'A'
    7 |                 int[] A = new int[N];
      |                       ^
a.cc:9:25: error: 'A' was not declared in this scope
    9 |                         A[i] = scanner.nextInt();
      |                         ^
a.cc:13:35: error: 'A' was not declared in this scope
   13 |                         int key = A[i];
      |                                   ^
a.cc:15:25: error: 'System' was not declared in this scope
   15 |                         System.out.println(Arrays.toString(A));
      |                         ^~~~~~
a.cc:15:44: error: 'Arrays' was not declared in this scope
   15 |                         System.out.println(Arrays.toString(A));
      |                                            ^~~~~~
a.cc:22:17: error: 'System' was not declared in this scope
   22 |                 System.out.println(Arrays.toString(A));
      |                 ^~~~~~
a.cc:22:36: error: 'Arrays' was not declared in this scope
   22 |                 System.out.println(Arrays.toString(A));
      |                                    ^~~~~~
a.cc:22:52: error: 'A' was not declared in this scope
   22 |                 System.out.println(Arrays.toString(A));
      |                                                    ^