Language: C++

using System;

namespace ConsoleApp3
{
	class Program
	{
		static void Main(string[] args)
		{

			int n, max = 0, m = 0, maxnum = 0;
			string str;
			n = int.Parse(Console.ReadLine());
			string[] ans = new string[n];
			int[] num = new int[n];
			/*入力*/
			for (int i = 0; i < n; i++)
			{
				str = Console.ReadLine() ;
				int j;
				for (j = 0; j < m; j++)
				{
					if (str == ans[j])
					{
						num[j]++;
						break;
					}
				}
				if (j == m)
				{
					num[j] = 1;
					ans[j] = str;
					m++;
				}
			}

			
			for (int i = 0; i < m; i++)
			{
				if (num[i] > max)
				{
					max = num[i];
					maxnum = 1;
					ans[0] = ans[i];
				}
				else if (num[i] == max)
					ans[maxnum++] = ans[i];
			}

			string[] ans2 = new string[maxnum];

			for (int i = 0; i < maxnum; i++) ans2[i] - ans[i];

			Array.Sort(ans2);
			for (int i = 0; i < maxnum; i++)
			{
				Console.WriteLine(ans2[i]);
			}
		}
	}
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:34: error: 'string' has not been declared
    7 |                 static void Main(string[] args)
      |                                  ^~~~~~
a.cc:7:43: error: expected ',' or '...' before 'args'
    7 |                 static void Main(string[] args)
      |                                           ^~~~
a.cc:59:10: error: expected ';' after class definition
   59 |         }
      |          ^
      |          ;
a.cc: In static member function 'static void ConsoleApp3::Program::Main(int*)':
a.cc:11:25: error: 'string' was not declared in this scope
   11 |                         string str;
      |                         ^~~~~~
a.cc:12:29: error: expected primary-expression before 'int'
   12 |                         n = int.Parse(Console.ReadLine());
      |                             ^~~
a.cc:13:32: error: expected primary-expression before ']' token
   13 |                         string[] ans = new string[n];
      |                                ^
a.cc:14:28: error: structured binding declaration cannot have type 'int'
   14 |                         int[] num = new int[n];
      |                            ^~
a.cc:14:28: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:14:28: error: empty structured binding declaration
a.cc:14:31: error: expected initializer before 'num'
   14 |                         int[] num = new int[n];
      |                               ^~~
a.cc:18:33: error: 'str' was not declared in this scope; did you mean 'std'?
   18 |                                 str = Console.ReadLine() ;
      |                                 ^~~
      |                                 std
a.cc:18:39: error: 'Console' was not declared in this scope
   18 |                                 str = Console.ReadLine() ;
      |                                       ^~~~~~~
a.cc:22:52: error: 'ans' was not declared in this scope
   22 |                                         if (str == ans[j])
      |                                                    ^~~
a.cc:24:49: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 |                                                 num[j]++;
      |                                                 ^~~
      |                                                 enum
a.cc:30:41: error: 'num' was not declared in this scope; did you mean 'enum'?
   30 |                                         num[j] = 1;
      |                                         ^~~
      |                                         enum
a.cc:31:41: error: 'ans' was not declared in this scope
   31 |                                         ans[j] = str;
      |                                         ^~~
a.cc:39:37: error: 'num' was not declared in this scope; did you mean 'enum'?
   39 |                                 if (num[i] > max)
      |                                     ^~~
      |                                     enum
a.cc:43:41: error: 'ans' was not declared in this scope
   43 |                                         ans[0] = ans[i];
      |                                         ^~~
a.cc:46:41: error: 'ans' was not declared in this scope
   46 |                                         ans[maxnum++] = ans[i];
      |                                         ^~~
a.cc:49:32: error: expected primary-expression before ']' token
   49 |                         string[] ans2 = new string[maxnum];
      |                                ^
a.cc:51:58: error: 'ans2' was not declared in this scope
   51 |                         for (int i = 0; i < maxnum; i++) ans2[i] - ans[i];
      |                                                          ^~~~
a.cc:51:68: error: 'ans' was not declared in this scope
   51 |                         for (int i = 0; i < maxnum; i++) ans2[i] - ans[i];
      |                                                                    ^~~
a.cc:53:25: error: 'Array' was not declared in this scope
   53 |                         Array.Sort(ans2);
      |                         ^~~~~
a.cc:53:36: error: 'ans2' was not declared in this scope
   53 |                         Array.Sort(ans2);
      |                                    ^~~~
a.cc:56:33: error: 'Console' was not declared in this scope
   56 |                                 Console.WriteLine(ans2[i]);
      |                                 ^~~~~~~