Language: C++

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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var input = Console.ReadLine().Split(' ');
            var flames = new List<int>();

            foreach (var item in input)
            {
                flames.Add(int.Parse(item));
            }

            var ave = flames.Average();

            int? min = null;
            var flamePoint = 0;
            var i = 0;

            foreach (var flame in flames)
            {
                if (min == null)
                {
                    min = (int)Math.Abs(flame - ave);
                }
                else
                {
                    if ((int)Math.Abs(flame - ave) < min)
                    {
                        min = flame;
                        flamePoint = i;
                    }
                }

                i++;
            }

            Console.WriteLine(flamePoint);
        }
    }
}


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:48:6: error: expected ';' after class definition
   48 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void A::Program::Main(int*)':
a.cc:13:13: error: 'var' was not declared in this scope
   13 |             var n = int.Parse(Console.ReadLine());
      |             ^~~
a.cc:14:17: error: expected ';' before 'input'
   14 |             var input = Console.ReadLine().Split(' ');
      |                 ^~~~~
a.cc:15:17: error: expected ';' before 'flames'
   15 |             var flames = new List<int>();
      |                 ^~~~~~
a.cc:17:26: error: expected ')' before 'item'
   17 |             foreach (var item in input)
      |                          ^~~~
a.cc:17:21: note: to match this '('
   17 |             foreach (var item in input)
      |                     ^
a.cc:17:13: error: 'foreach' was not declared in this scope
   17 |             foreach (var item in input)
      |             ^~~~~~~
a.cc:22:17: error: expected ';' before 'ave'
   22 |             var ave = flames.Average();
      |                 ^~~
a.cc:24:16: error: expected unqualified-id before '?' token
   24 |             int? min = null;
      |                ^
a.cc:25:17: error: expected ';' before 'flamePoint'
   25 |             var flamePoint = 0;
      |                 ^~~~~~~~~~
a.cc:26:17: error: expected ';' before 'i'
   26 |             var i = 0;
      |                 ^
a.cc:28:26: error: expected ')' before 'flame'
   28 |             foreach (var flame in flames)
      |                          ^~~~~
a.cc:28:21: note: to match this '('
   28 |             foreach (var flame in flames)
      |                     ^
a.cc:46:13: error: 'Console' was not declared in this scope
   46 |             Console.WriteLine(flamePoint);
      |             ^~~~~~~
a.cc:46:31: error: 'flamePoint' was not declared in this scope
   46 |             Console.WriteLine(flamePoint);
      |                               ^~~~~~~~~~