Language: C++

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

namespace ConsoleApplication
{
    class Program
    {
        static void Main()
        {
            new Solution().answer();
        }
    }

    class Solution
    {
        string[] input;

        public Solution()
        {
            input = Console.ReadLine().Split(' ');
        }
        
        public void answer()
        {
            int A = Convert.ToInt32(input[0]);
            int B = Convert.ToInt32(input[1]);
            int C = A + B;

            if (C < 10) { Console.WriteLine(C.ToString()); }
            else { Console.WriteLine("error"); }
        }
    }
}

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:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:15:6: error: expected ';' after class definition
   15 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApplication::Program::Main()':
a.cc:13:17: error: expected type-specifier before 'Solution'
   13 |             new Solution().answer();
      |                 ^~~~~~~~
a.cc: At global scope:
a.cc:19:9: error: 'string' does not name a type
   19 |         string[] input;
      |         ^~~~~~
a.cc:21:15: error: expected ':' before 'Solution'
   21 |         public Solution()
      |               ^~~~~~~~~
      |               :
a.cc:26:15: error: expected ':' before 'void'
   26 |         public void answer()
      |               ^~~~~
      |               :
a.cc:35:6: error: expected ';' after class definition
   35 |     }
      |      ^
      |      ;
a.cc: In constructor 'ConsoleApplication::Solution::Solution()':
a.cc:23:13: error: 'input' was not declared in this scope; did you mean 'int'?
   23 |             input = Console.ReadLine().Split(' ');
      |             ^~~~~
      |             int
a.cc:23:21: error: 'Console' was not declared in this scope
   23 |             input = Console.ReadLine().Split(' ');
      |                     ^~~~~~~
a.cc: In member function 'void ConsoleApplication::Solution::answer()':
a.cc:28:21: error: 'Convert' was not declared in this scope
   28 |             int A = Convert.ToInt32(input[0]);
      |                     ^~~~~~~
a.cc:28:37: error: 'input' was not declared in this scope; did you mean 'int'?
   28 |             int A = Convert.ToInt32(input[0]);
      |                                     ^~~~~
      |                                     int
a.cc:32:27: error: 'Console' was not declared in this scope
   32 |             if (C < 10) { Console.WriteLine(C.ToString()); }
      |                           ^~~~~~~
a.cc:32:47: error: request for member 'ToString' in 'C', which is of non-class type 'int'
   32 |             if (C < 10) { Console.WriteLine(C.ToString()); }
      |                                               ^~~~~~~~
a.cc:33:20: error: 'Console' was not declared in this scope
   33 |             else { Console.WriteLine("error"); }
      |                    ^~~~~~~