Language: C++

using System.IO;
using System.Text;
using System;
   
   
namespace AOJ
{
    class Scanner : StringReader
    {
        string _currentWord;
   
        public Scanner(string source) : base(source)
        {
            ReadNextWord();
        }
   
        private void ReadNextWord()
        {
            StringBuilder sb = new StringBuilder();
            do
            {
                var next = Read();
                if (next < 0)
                    break;
                var nextChar = (char)next;
                if (char.IsWhiteSpace(nextChar))
                    break;
                sb.Append(nextChar);
            } while (true);
            while ((Peek() >= 0) && (char.IsWhiteSpace((char)Peek())))
                Read();
            _currentWord = sb.Length > 0 ? sb.ToString() : null;
        }
   
        public bool HasNextInt()
        {
            if (_currentWord == null)
                return false;
            int dummy;
            return int.TryParse(_currentWord, out dummy);
        }
   
        public int NextInt()
        {
            try
            {
                return int.Parse(_currentWord);
            }
            finally
            {
                ReadNextWord();
            }
        }
   
        public bool HasNextDouble()
        {
            if (_currentWord == null)
                return false;
            double dummy;
            return double.TryParse(_currentWord, out dummy);
        }
   
        public double NextDouble()
        {
            try
            {
                return double.Parse(_currentWord);
            }
            finally
            {
                ReadNextWord();
            }
        }
   
        public bool HasNext()
        {
            return _currentWord != null;
        }
    }
   
    class Program
    {
        public static int[] InsertionSort(int[] unsorted)
        {
            var list = new int[unsorted.Length];
            unsorted.CopyTo(list, 0);
            for (var i = 1; i < list.Length; i++)
            {
                var key = list[i];
                int j;
                for (j = i - 1; j >= 0 && list[j] > key; j--)
                {
                    list[j + 1] = list[j];
                }
                list[j + 1] = key;
                Console.WriteLine(string.Join(" ", Array.ConvertAll(list, s => s.ToString())));
            }
            return list;
        }
   
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Scanner s = new Scanner(Console.ReadLine());
   
            var unsorted = new int[n];
            for (int i=0; s.HasNext(); i++)
            {
                unsorted[i] = s.NextInt();
            }
            foreach (var i in unsorted) Console.Write(i + " ");
            Console.WriteLine();
            InsertionSort(unsorted);
   
   
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System.IO;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Text;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System;
      |       ^~~~~~
a.cc:9:5: error: expected class-name before '{' token
    9 |     {
      |     ^
a.cc:10:9: error: 'string' does not name a type
   10 |         string _currentWord;
      |         ^~~~~~
a.cc:12:15: error: expected ':' before 'Scanner'
   12 |         public Scanner(string source) : base(source)
      |               ^~~~~~~~
      |               :
a.cc:12:30: error: expected ')' before 'source'
   12 |         public Scanner(string source) : base(source)
      |                       ~      ^~~~~~~
      |                              )
a.cc:17:16: error: expected ':' before 'void'
   17 |         private void ReadNextWord()
      |                ^~~~~
      |                :
a.cc:35:15: error: expected ':' before 'bool'
   35 |         public bool HasNextInt()
      |               ^~~~~
      |               :
a.cc:43:15: error: expected ':' before 'int'
   43 |         public int NextInt()
      |               ^~~~
      |               :
a.cc:55:15: error: expected ':' before 'bool'
   55 |         public bool HasNextDouble()
      |               ^~~~~
      |               :
a.cc:63:15: error: expected ':' before 'double'
   63 |         public double NextDouble()
      |               ^~~~~~~
      |               :
a.cc:75:15: error: expected ':' before 'bool'
   75 |         public bool HasNext()
      |               ^~~~~
      |               :
a.cc:79:6: error: expected ';' after class definition
   79 |     }
      |      ^
      |      ;
a.cc: In member function 'void AOJ::Scanner::ReadNextWord()':
a.cc:19:13: error: 'StringBuilder' was not declared in this scope
   19 |             StringBuilder sb = new StringBuilder();
      |             ^~~~~~~~~~~~~
a.cc:22:17: error: 'var' was not declared in this scope
   22 |                 var next = Read();
      |                 ^~~
a.cc:23:21: error: 'next' was not declared in this scope
   23 |                 if (next < 0)
      |                     ^~~~
a.cc:25:21: error: expected ';' before 'nextChar'
   25 |                 var nextChar = (char)next;
      |                     ^~~~~~~~
a.cc:26:25: error: expected unqualified-id before '.' token
   26 |                 if (char.IsWhiteSpace(nextChar))
      |                         ^
a.cc:28:17: error: 'sb' was not declared in this scope
   28 |                 sb.Append(nextChar);
      |                 ^~
a.cc:28:27: error: 'nextChar' was not declared in this scope
   28 |                 sb.Append(nextChar);
      |                           ^~~~~~~~
a.cc:30:21: error: 'Peek' was not declared in this scope
   30 |             while ((Peek() >= 0) && (char.IsWhiteSpace((char)Peek())))
      |                     ^~~~
a.cc:30:38: error: expected primary-expression before 'char'
   30 |             while ((Peek() >= 0) && (char.IsWhiteSpace((char)Peek())))
      |                                      ^~~~
a.cc:30:38: error: expected ')' before 'char'
a.cc:30:37: note: to match this '('
   30 |             while ((Peek() >= 0) && (char.IsWhiteSpace((char)Peek())))
      |                                     ^
a.cc:31:23: error: expected ')' before ';' token
   31 |                 Read();
      |                       ^
a.cc:30:19: note: to match this '('
   30 |             while ((Peek() >= 0) && (char.IsWhiteSpace((char)Peek())))
      |                   ^
a.cc:32:13: error: '_currentWord' was not declared in this scope
   32 |             _currentWord = sb.Length > 0 ? sb.ToString() : null;
      |             ^~~~~~~~~~~~
a.cc:32:28: error: 'sb' was not declared in this scope
   32 |             _currentWord = sb.Length > 0 ? sb.ToString() : null;
      |                            ^~
a.cc:32:60: error: 'null' was not declared in this scope
   32 |             _currentWord = sb.Length > 0 ? sb.ToString() : null;
      |                                                            ^~~~
a.cc: In member function 'bool AOJ::Scanner::HasNextInt()':
a.cc:37:17: error: '_currentWord' was not declared in this scope
   37 |             if (_currentWord == null)
      |                 ^~~~~~~~~~~~
a.cc:37:33: error: 'null' was not declared in this scope
   37 |             if (_currentWord == null)
      |                                 ^~~~
a.cc:40:20: error: expected primary-expression before 'int'
   40 |             return int.TryParse(_currentWord, out dummy);
      |                    ^~~
a.cc:40:20: error: expected ';' before 'int'
a.cc:40:23: error: expected unqualified-id before '.' token
   40 |             return int.TryParse(_currentWord, out dummy);
      |                       ^
a.cc: In member function 'int AOJ::Scanner::NextInt()':
a.cc:47:24: error: expected primary-expression before 'int'
   47 |                 return int.Parse(_currentWord);
      |                        ^~~
a.cc:47:24: error: expected ';' before 'int'
a.cc:47:27: error: expected unqualified-id before '.' token
   47 |                 return int.Parse(_currentWord);
      |                           ^
a.cc:49:13: error: expected 'catch' before 'finally'
   49 |             finally
      |             ^~~~~~~
a.cc:49:13: error: expected '(' before 'finally'
a.cc:49:13: error: 'finally' does not name a type
a.cc:50:13: error: expected ')' before '{' token
   50 |             {
      |             ^
a.cc:49:13: note: to match this '('
   49 |             finally
      |             ^~~~~~~
a.cc: In member function 'bool AOJ::Scanner::HasNextDouble()':
a.cc:57:17: error: '_currentWord' was not declared in this scope
   57 |             if (_currentWord == null)
      |                 ^~~~~~~~~~~~
a.cc:57:33: error: 'null' was not declared in this scope
   57 |             if (_currentWord == null)
      |                                 ^~~~
a.cc:60:20: error: expected primary-expression before 'double'
   60 |             return double.TryParse(_currentWord, out dummy);
      |                    ^~~~~~
a.cc:60:20: error: expected ';' before 'double'
a.cc:60:26: error: expected unqualified-id before '.' token
   60 |             return double.TryParse(_currentWord, out dummy);
      |                          ^
a.cc: In member function 'double AOJ::Scanner::NextDouble()':
a.cc:67:24: error: expected primary-expression before 'double'
   67 |                 return double.Parse(_currentWord);
      |                        ^~~~~~
a.cc:67:24: error: expected ';' before 'double'
a.cc:67:30: error: expected unqualified-id before '.' token
   67 |                 return double.Parse(_currentWord);
      |                              ^
a.cc:69:13: error: expected 'catch' before 'finally'
   69 |             finally
      |             ^~~~~~~
a.cc:69:13: error: expected '(' before 'finally'
a.cc:69:13: error: 'finally' does not name a type
a.cc:70:13: error: expected ')' before '{' token
   70 |             {
      |             ^
a.cc:69:13: note: to match this '('
   69 |             finally
      |             ^~~~~~~
a.cc: In member function 'bool AOJ::Scanner::HasNext()':
a.cc:77:20: error: '_currentWord' was not declared in this scope
   77 |             return _currentWord != null;
      |                    ^~~~~~~~~~~~
a.cc:77:36: error: 'null' was not declared in this scope
   77 |             return _currentWord != null;
      |                                    ^~~~
a.cc: At global scope:
a.cc:83:15: error: expected ':' before 'static'
   83 |         public static int[] InsertionSort(int[] unsorted)
      |               ^~~~~~~
      |               :
a.cc:83:26: error: expected unqualified-id before '[' token
   83 |         public static int[] InsertionSort(int[] unsorted)
      |                          ^
a.cc:101:26: error: 'string' has not been declared
  101 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:101:35: error: expected ',' or '...' before 'args'
  101 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:117:6: error: expected ';' after class definition
  117 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void AOJ::Program::Main(int*)':
a.cc:103:21: error: expected primary-expression before 'int'
  103 |             int n = int.Parse(Console.ReadLine());
      |                     ^~~
a.cc:104:37: error: 'Console' was not declared in this scope
  104 |             Scanner s = new Scanner(Console.ReadLine());
      |                                     ^~~~~~~
a.cc:106:13: error: 'var' was not declared in this scope
  106 |             var unsorted = new int[n];
      |             ^~~
a.cc:109:17: error: 'unsorted' was not declared in this scope
  109 |                 unsorted[i] = s.NextInt();
      |                 ^~~~~~~~
a.cc:111:26: error: expected ')' before 'i'
  111 |             foreach (var i in unsorted) Console.Write(i + " ");
      |                          ^
a.cc:111:21: note: to match this '('
  111 |             foreach (var i in unsorted) Console.Write(i + " ");
      |                     ^
a.cc:111:13: error: 'foreach' was not declared in this scope
  111 |             foreach (var i in unsorted) Console.Write(i + " ");
      |             ^~~~~~~
a.cc:113:27: error: 'unsorted' was not declared in this scope
  113 |             InsertionSort(unsorted);
      |                           ^~~~~~~~
a.cc:113:13: error: 'InsertionSort' was not declared in this scope
  113 |             InsertionSort(unsorted);
      |             ^~~~~~~~~~~~~