Language: C++

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            double sum = 0;
            int[] a = new int[100];
            n = int.Parse(Console.ReadLine());
            a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            for(int i = 0; i < n; i++)
            {
                sum += a[i];
            }
            sum /= n;
            long sum2 = 0, sum3 = 0;
            for(int i = 0; i < n; i++)
            {
                sum2 += (long)Math.Pow(a[i] - Math.Floor(sum), 2);
                sum3 += (long)Math.Pow(a[i] - Math.Ceiling(sum), 2);
            }
            if (sum3 < sum2) sum2 = sum3;
            Console.WriteLine(sum2);
        }
    }
}


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:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:32:6: error: expected ';' after class definition
   32 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApplication1::Program::Main(int*)':
a.cc:15:16: error: structured binding declaration cannot have type 'int'
   15 |             int[] a = new int[100];
      |                ^~
a.cc:15:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:15:16: error: empty structured binding declaration
a.cc:15:19: error: expected initializer before 'a'
   15 |             int[] a = new int[100];
      |                   ^
a.cc:16:17: error: expected primary-expression before 'int'
   16 |             n = int.Parse(Console.ReadLine());
      |                 ^~~
a.cc:17:13: error: 'a' was not declared in this scope
   17 |             a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
      |             ^
a.cc:17:17: error: 'Console' was not declared in this scope
   17 |             a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
      |                 ^~~~~~~
a.cc:17:54: error: expected primary-expression before 'int'
   17 |             a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
      |                                                      ^~~
a.cc:26:31: error: 'Math' was not declared in this scope
   26 |                 sum2 += (long)Math.Pow(a[i] - Math.Floor(sum), 2);
      |                               ^~~~