Language: C++

package main

import (
    "bufio"
    "fmt"
    "os"
    "strconv"
    "strings"
)

type Io struct {
    reader    *bufio.Reader
    writer    *bufio.Writer
    tokens    []string
    nextToken int
}

func NewIo() *Io {
    return &Io{
        reader: bufio.NewReader(os.Stdin),
        writer: bufio.NewWriter(os.Stdout),
    }
}

func (io *Io) Flush() {
    err := io.writer.Flush()
    if err != nil {
        panic(err)
    }
}

func (io *Io) NextLine() string {
    var buffer []byte
    for {
        line, isPrefix, err := io.reader.ReadLine()
        if err != nil {
            panic(err)
        }
        buffer = append(buffer, line...)
        if !isPrefix {
            break
        }
    }
    return string(buffer)
}

func (io *Io) Next() string {
    for io.nextToken >= len(io.tokens) {
        line := io.NextLine()
        io.tokens = strings.Fields(line)
        io.nextToken = 0
    }
    r := io.tokens[io.nextToken]
    io.nextToken++
    return r
}

func (io *Io) NextInt() int {
    i, err := strconv.Atoi(io.Next())
    if err != nil {
        panic(err)
    }
    return i
}

func (io *Io) NextFloat() float64 {
    i, err := strconv.ParseFloat(io.Next(), 64)
    if err != nil {
        panic(err)
    }
    return i
}

func (io *Io) PrintLn(a ...interface{}) {
    fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
    fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntLn(a []int) {
    b := []interface{}{}
    for _, x := range a {
        b = append(b, x)
    }
    io.PrintLn(b...)
}

func (io *Io) PrintStringLn(a []string) {
    b := []interface{}{}
    for _, x := range a {
        b = append(b, x)
    }
    io.PrintLn(b...)
}

func main() {
    io := NewIo()
	defer io.Flush()
	
	N := io.NextInt()
	A := make([]int, N)
	for i:=0; i<N; i++ {
		A[i] = io.NextInt()
	}

	for i:=1; i<N; i++ {
		io.PrintIntLn(A)
		 v := A[i]
		 j := i-1
		 for j >= 0 && A[j] > v {
			 A[j+1] = A[j]
			 j--
		 }
		 A[j+1] = v
	}
	io.PrintIntLn(A)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:18:1: error: 'func' does not name a type
   18 | func NewIo() *Io {
      | ^~~~
a.cc:25:6: error: expected constructor, destructor, or type conversion before '(' token
   25 | func (io *Io) Flush() {
      |      ^
a.cc:32:6: error: expected constructor, destructor, or type conversion before '(' token
   32 | func (io *Io) NextLine() string {
      |      ^
a.cc:47:6: error: expected constructor, destructor, or type conversion before '(' token
   47 | func (io *Io) Next() string {
      |      ^
a.cc:58:6: error: expected constructor, destructor, or type conversion before '(' token
   58 | func (io *Io) NextInt() int {
      |      ^
a.cc:66:6: error: expected constructor, destructor, or type conversion before '(' token
   66 | func (io *Io) NextFloat() float64 {
      |      ^
a.cc:74:6: error: expected constructor, destructor, or type conversion before '(' token
   74 | func (io *Io) PrintLn(a ...interface{}) {
      |      ^
a.cc:74:39: error: expected unqualified-id before ')' token
   74 | func (io *Io) PrintLn(a ...interface{}) {
      |                                       ^
a.cc:78:6: error: expected constructor, destructor, or type conversion before '(' token
   78 | func (io *Io) Printf(format string, a ...interface{}) {
      |      ^
a.cc:78:53: error: expected unqualified-id before ')' token
   78 | func (io *Io) Printf(format string, a ...interface{}) {
      |                                                     ^
a.cc:82:6: error: expected constructor, destructor, or type conversion before '(' token
   82 | func (io *Io) PrintIntLn(a []int) {
      |      ^
a.cc:90:6: error: expected constructor, destructor, or type conversion before '(' token
   90 | func (io *Io) PrintStringLn(a []string) {
      |      ^
a.cc:98:1: error: 'func' does not name a type
   98 | func main() {
      | ^~~~