Language: C++

using System;
using System.IO;
using System.Configuration;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var dic = new Dictionary<int, int>();
            int? maxProf = null;
            for (int i= 0; i < n; ++i)
            {
                dic.Add(i,int.Parse(Console.ReadLine()));
            }
            for(int i = 0; i < n; ++i)
            {
                for(int j = i+1; j < n-1; ++j)
                {
                    if(maxProf == null)
                    {
                        maxProf = dic[j] - dic[i];
                    }
                    else
                    {
                        if(maxProf < dic[j] - dic[i])
                        {
                            maxProf = dic[j] - dic[i];
                        }
                    }
                }
            }
            Console.WriteLine(maxProf);
        }

    }
}

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.IO;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Configuration;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Reflection;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Linq;
      |       ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'System'
    7 | using System.Text;
      |       ^~~~~~
a.cc:8:7: error: expected nested-name-specifier before 'System'
    8 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:14:26: error: 'string' has not been declared
   14 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:14:35: error: expected ',' or '...' before 'args'
   14 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:43:6: error: expected ';' after class definition
   43 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void AOJ::Program::Main(int*)':
a.cc:16:21: error: expected primary-expression before 'int'
   16 |             int n = int.Parse(Console.ReadLine());
      |                     ^~~
a.cc:17:13: error: 'var' was not declared in this scope
   17 |             var dic = new Dictionary<int, int>();
      |             ^~~
a.cc:18:16: error: expected unqualified-id before '?' token
   18 |             int? maxProf = null;
      |                ^
a.cc:21:17: error: 'dic' was not declared in this scope
   21 |                 dic.Add(i,int.Parse(Console.ReadLine()));
      |                 ^~~
a.cc:21:27: error: expected primary-expression before 'int'
   21 |                 dic.Add(i,int.Parse(Console.ReadLine()));
      |                           ^~~
a.cc:27:24: error: 'maxProf' was not declared in this scope
   27 |                     if(maxProf == null)
      |                        ^~~~~~~
a.cc:27:35: error: 'null' was not declared in this scope
   27 |                     if(maxProf == null)
      |                                   ^~~~
a.cc:29:35: error: 'dic' was not declared in this scope
   29 |                         maxProf = dic[j] - dic[i];
      |                                   ^~~
a.cc:33:38: error: 'dic' was not declared in this scope
   33 |                         if(maxProf < dic[j] - dic[i])
      |                                      ^~~
a.cc:40:13: error: 'Console' was not declared in this scope
   40 |             Console.WriteLine(maxProf);
      |             ^~~~~~~
a.cc:40:31: error: 'maxProf' was not declared in this scope
   40 |             Console.WriteLine(maxProf);
      |                               ^~~~~~~