Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgrammingContest
{
    class Writer : IDisposable
    {
        private System.IO.TextWriter writer;
        private StringBuilder sb;
        private bool isReactive;
        public Writer(string path)
            : this(new System.IO.StreamWriter(path))
        {
        }
        public Writer(bool isReactive)
            : this(null, isReactive)
        {
        }
        public Writer(System.IO.TextWriter writer = null,
                        bool isReactive = false)
        {
            this.writer = (writer ?? Console.Out);
            this.isReactive = isReactive;
            if (!this.isReactive)
            {
                this.sb = new StringBuilder();
            }
        }
        public void Dispose()
        {
            if (!this.isReactive)
            {
                this.writer.Write(sb.ToString());
            }
            if (!this.writer.Equals(Console.Out))
            {
                this.writer.Dispose();
            }
        }
        public void Write(object val)
        {
            if (this.isReactive)
            {
                this.writer.Write(val.ToString());
                this.writer.Flush();
            }
            else
            {
                this.sb.Append(val.ToString());
            }
        }
        public void Write(string format, params object[] vals)
        {
            if (this.isReactive)
            {
                this.writer.Write(format, vals);
                this.writer.Flush();
            }
            else
            {
                this.sb.AppendFormat(format, vals);
            }
        }
        public void WriteLine(object val = null)
        {
            this.Write((val ?? string.Empty).ToString() + System.Environment.NewLine);
        }
        public void WriteLine(int val)
        {
            this.WriteLine(val.ToString());
        }
        public void WriteLine(long val)
        {
            this.WriteLine(val.ToString());
        }
        public void WriteLine(string val)
        {
            this.WriteLine((object)val);
        }
        public void WriteLine(string format, params object[] vals)
        {
            this.Write(format + System.Environment.NewLine, vals);
        }
    }

    class Scanner : IDisposable
    {
        private Queue<string> buffer;
        private char[] sep;
        private System.IO.TextReader reader;
        public Scanner(string path, char[] sep = null)
            : this(new System.IO.StreamReader(path), sep)
        {
        }
        public Scanner(System.IO.TextReader reader = null,
                        char[] sep = null)
        {
            this.buffer = new Queue<string>();
            this.sep = (sep ?? new char[] { ' ' });
            this.reader = (reader ?? Console.In);
        }
        private void CheckBuffer()
        {
            if (this.buffer.Count == 0 && this.reader.Peek() != -1)
            {
                string str = string.Empty;
                for (; string.IsNullOrEmpty(str);
                    str = this.reader.ReadLine()) ;

                str.Split(this.sep).ToList()
                   .ForEach(el => this.buffer.Enqueue(el));
            }
        }

        public void Dispose()
        {
            if (!this.reader.Equals(Console.In))
            {
                this.reader.Dispose();
            }
        }

        public string Next
        {
            get
            {
                this.CheckBuffer();
                return this.buffer.Dequeue();
            }
        }
        public string[] GetStringArray(int N)
        {
            return Enumerable.Range(0, N)
                             .Select(e => this.Next)
                             .ToArray();
        }

        public int NextInt
        {
            get
            {
                return int.Parse(this.Next);
            }
        }
        public int[] GetIntArray(int N)
        {
            return Enumerable.Range(0, N)
                             .Select(e => this.NextInt)
                             .ToArray();
        }

        public double NextDouble
        {
            get
            {
                return double.Parse(this.Next);
            }
        }
        public double[] GetdoubleArray(int N)
        {
            return Enumerable.Range(0, N)
                             .Select(e => this.NextDouble)
                             .ToArray();
        }

        public long NextLong
        {
            get
            {
                return long.Parse(this.Next);
            }
        }
        public long[] GetLongArray(int N)
        {
            return Enumerable.Range(0, N)
                             .Select(e => this.NextLong)
                             .ToArray();
        }

        public bool IsEnd
        {
            get
            {
                this.CheckBuffer();
                return this.buffer.Count == 0;
            }
        }
    }

    class MainClass : IDisposable
    {
        Scanner sc;
        Writer wr;
        const string backPath = "..";
        char dirSep = System.IO.Path.DirectorySeparatorChar;
        string inFilePath = string.Empty;
        string outFilePath = string.Empty;
        public MainClass()
        {
            this.inFilePath = MainClass.backPath
                            + this.dirSep
                            + MainClass.backPath
                            + this.dirSep
                            + "in.txt";
            this.outFilePath = MainClass.backPath
                             + this.dirSep
                             + MainClass.backPath
                             + this.dirSep
                             + "out.txt";

            this.wr = new Writer(this.IsReactive);
            //this.wr = new Writer(this.outFilePath);
#if DEBUG
            if (!this.IsReactive)
            {
                this.sc = new Scanner(this.inFilePath);
            }
            else
            {
                this.sc = new Scanner();
            }
#else
            this.sc = new Scanner();
#endif
        }
        static void Main(string[] args)
        {
            using (var mainClass = new MainClass())
            {
                mainClass.Solve();
            }
        }

        public void Dispose()
        {
            if (this.sc != null)
            {
                this.sc.Dispose();
                this.sc = null;
            }
            if (this.wr != null)
            {
                this.wr.Dispose();
                this.wr = null;
            }
#if DEBUG
            Console.WriteLine("続行するには何かキーを押してください...");
            Console.ReadKey();
#endif
        }

        void MakeTestCase()
        {
            var rand = new Random();
            if (this.wr != null)
            {
                this.wr.Dispose();
            }
            this.wr = new Writer(inFilePath);


        }

        void Solve()
        {
            for (int i = 0; i < 3; i++)
            {
                wr.Write(sc.Next[i]);
            }
        }

        private bool IsReactive { get; } = false; // TODO: reactive check !!
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:9:5: error: expected class-name before '{' token
    9 |     {
      |     ^
a.cc:10:16: error: expected ':' before 'System'
   10 |         private System.IO.TextWriter writer;
      |                ^~~~~~~
      |                :
a.cc:10:17: error: 'System' does not name a type
   10 |         private System.IO.TextWriter writer;
      |                 ^~~~~~
a.cc:11:16: error: expected ':' before 'StringBuilder'
   11 |         private StringBuilder sb;
      |                ^~~~~~~~~~~~~~
      |                :
a.cc:11:17: error: 'StringBuilder' does not name a type
   11 |         private StringBuilder sb;
      |                 ^~~~~~~~~~~~~
a.cc:12:16: error: expected ':' before 'bool'
   12 |         private bool isReactive;
      |                ^~~~~
      |                :
a.cc:13:15: error: expected ':' before 'Writer'
   13 |         public Writer(string path)
      |               ^~~~~~~
      |               :
a.cc:13:29: error: expected ')' before 'path'
   13 |         public Writer(string path)
      |                      ~      ^~~~~
      |                             )
a.cc:17:15: error: expected ':' before 'Writer'
   17 |         public Writer(bool isReactive)
      |               ^~~~~~~
      |               :
a.cc:21:15: error: expected ':' before 'Writer'
   21 |         public Writer(System.IO.TextWriter writer = null,
      |               ^~~~~~~
      |               :
a.cc:21:29: error: expected ')' before '.' token
   21 |         public Writer(System.IO.TextWriter writer = null,
      |                      ~      ^
      |                             )
a.cc:31:15: error: expected ':' before 'void'
   31 |         public void Dispose()
      |               ^~~~~
      |               :
a.cc:42:15: error: expected ':' before 'void'
   42 |         public void Write(object val)
      |               ^~~~~
      |               :
a.cc:42:27: error: 'object' has not been declared
   42 |         public void Write(object val)
      |                           ^~~~~~
a.cc:54:15: error: expected ':' before 'void'
   54 |         public void Write(string format, params object[] vals)
      |               ^~~~~
      |               :
a.cc:54:27: error: 'string' has not been declared
   54 |         public void Write(string format, params object[] vals)
      |                           ^~~~~~
a.cc:54:42: error: 'params' has not been declared
   54 |         public void Write(string format, params object[] vals)
      |                                          ^~~~~~
a.cc:54:58: error: expected ',' or '...' before 'vals'
   54 |         public void Write(string format, params object[] vals)
      |                                                          ^~~~
a.cc:66:15: error: expected ':' before 'void'
   66 |         public void WriteLine(object val = null)
      |               ^~~~~
      |               :
a.cc:66:31: error: 'object' has not been declared
   66 |         public void WriteLine(object val = null)
      |                               ^~~~~~
a.cc:70:15: error: expected ':' before 'void'
   70 |         public void WriteLine(int val)
      |               ^~~~~
      |               :
a.cc:70:21: error: 'void ProgrammingContest::Writer::WriteLine(int)' cannot be overloaded with 'void ProgrammingContest::Writer::WriteLine(int)'
   70 |         public void WriteLine(int val)
      |                     ^~~~~~~~~
a.cc:66:21: note: previous declaration 'void ProgrammingContest::Writer::WriteLine(int)'
   66 |         public void WriteLine(object val = null)
      |                     ^~~~~~~~~
a.cc:74:15: error: expected ':' before 'void'
   74 |         public void WriteLine(long val)
      |               ^~~~~
      |               :
a.cc:78:15: error: expected ':' before 'void'
   78 |         public void WriteLine(string val)
      |               ^~~~~
      |               :
a.cc:78:31: error: 'string' has not been declared
   78 |         public void WriteLine(string val)
      |                               ^~~~~~
a.cc:78:21: error: 'void ProgrammingContest::Writer::WriteLine(int)' cannot be overloaded with 'void ProgrammingContest::Writer::WriteLine(int)'
   78 |         public void WriteLine(string val)
      |                     ^~~~~~~~~
a.cc:66:21: note: previous declaration 'void ProgrammingContest::Writer::WriteLine(int)'
   66 |         public void WriteLine(object val = null)
      |                     ^~~~~~~~~
a.cc:82:15: error: expected ':' before 'void'
   82 |         public void WriteLine(string format, params object[] vals)
      |               ^~~~~
      |               :
a.cc:82:31: error: 'string' has not been declared
   82 |         public void WriteLine(string format, params object[] vals)
      |                               ^~~~~~
a.cc:82:46: error: 'params' has not been declared
   82 |         public void WriteLine(string format, params object[] vals)
      |                                              ^~~~~~
a.cc:82:62: error: expected ',' or '...' before 'vals'
   82 |         public void WriteLine(string format, params object[] vals)
      |                                                              ^~~~
a.cc:86:6: error: expected ';' after class definition
   86 |     }
      |      ^
      |      ;
a.cc:66:44: error: 'null' was not declared in this scope
   66 |         public void WriteLine(object val = null)
      |                                            ^~~~
a.cc: In constructor 'ProgrammingContest::Writer::Writer(bool)':
a.cc:18:15: error: expected identifier before 'this'
   18 |             : this(null, isReactive)
      |               ^~~~
a.cc:18:15: error: expected '{' before 'this'
a.cc: In member function 'void ProgrammingContest::Writer::Dispose()':
a.cc:33:23: error: request for member 'isReactive' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   33 |             if (!this.isReactive)
      |                       ^~~~~~~~~~
a.cc:35:22: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   35 |                 this.writer.Write(sb.ToString());
      |                      ^~~~~~
a.cc:35:35: error: 'sb' was not declared in this scope
   35 |                 this.writer.Write(sb.ToString());
      |                                   ^~
a.cc:37:23: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   37 |             if (!this.writer.Equals(Console.Out))
      |                       ^~~~~~
a.cc:37:37: error: 'Console' was not declared in this scope
   37 |             if (!this.writer.Equals(Console.Out))
      |                                     ^~~~~~~
a.cc:39:22: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   39 |                 this.writer.Dispose();
      |                      ^~~~~~
a.cc: In member function 'void ProgrammingContest::Writer::Write(int)':
a.cc:44:22: error: request for member 'isReactive' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   44 |             if (this.isReactive)
      |                      ^~~~~~~~~~
a.cc:46:22: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   46 |                 this.writer.Write(val.ToString());
      |                      ^~~~~~
a.cc:46:39: error: request for member 'ToString' in 'val', which is of non-class type 'int'
   46 |                 this.writer.Write(val.ToString());
      |                                       ^~~~~~~~
a.cc:47:22: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   47 |                 this.writer.Flush();
      |                      ^~~~~~
a.cc:51:22: error: request for member 'sb' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   51 |                 this.sb.Append(val.ToString());
      |                      ^~
a.cc:51:36: error: request for member 'ToString' in 'val', which is of non-class type 'int'
   51 |                 this.sb.Append(val.ToString());
      |                                    ^~~~~~~~
a.cc: In member function 'void ProgrammingContest::Writer::Write(int, int*)':
a.cc:56:22: error: request for member 'isReactive' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   56 |             if (this.isReactive)
      |                      ^~~~~~~~~~
a.cc:58:22: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   58 |                 this.writer.Write(format, vals);
      |                      ^~~~~~
a.cc:58:43: error: 'vals' was not declared in this scope
   58 |                 this.writer.Write(format, vals);
      |                                           ^~~~
a.cc:59:22: error: request for member 'writer' in '(ProgrammingContest::Writer*)this', which is of pointer type 'ProgrammingContest::Writer*' (maybe you meant to use '->' ?)
   59 |                 this.writer.Flush();
      |                      ^~~~~~
a.cc:63:22: error: request for member 'sb' in '(ProgrammingContest::Writ