Language: C++

using System;
using System.Runtime.InteropServices;

namespace consoleapp01
{
    class foo
    {
        
        static void Main()
        {
            int N, M;
            int allowgate = 0; //ゲートを通過できるIDカード
            string[] st = Console.ReadLine().Split(' ');
            N = int.Parse(st[0]);
            M = int.Parse(st[1]);
            int[,] LM = new int[M, 2];
            int[] A = new int[N];

            for (int i = 0; i < N; i++)
            {
                A[i] = 0;
            }

            for (int i = 0; i < M; i++)
            {
                string[] st2 = Console.ReadLine().Split(' ');
                LM[i, 0] = int.Parse(st2[0]);
                LM[i, 1] = int.Parse(st2[1]);
            }

            for (int i = 0; i < M; i++)
            {
                for (int j = LM[i, 0]; j <= LM[i, 1]; j++)
                {
                    A[j-1]++;
                }       
            }

            for (int i = 0; i < N; i++)
            {
                if (A[i] == M)
                {
                    allowgate++;
                }
            }

            Console.WriteLine(allowgate);
        
            
        }
    }
}

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.Runtime.InteropServices;
      |       ^~~~~~
a.cc:51:6: error: expected ';' after class definition
   51 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void consoleapp01::foo::Main()':
a.cc:13:13: error: 'string' was not declared in this scope
   13 |             string[] st = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:13:20: error: expected primary-expression before ']' token
   13 |             string[] st = Console.ReadLine().Split(' ');
      |                    ^
a.cc:14:17: error: expected primary-expression before 'int'
   14 |             N = int.Parse(st[0]);
      |                 ^~~
a.cc:15:17: error: expected primary-expression before 'int'
   15 |             M = int.Parse(st[1]);
      |                 ^~~
a.cc:16:17: error: expected identifier before ',' token
   16 |             int[,] LM = new int[M, 2];
      |                 ^
a.cc:16:17: error: expected ']' before ',' token
a.cc:16:16: error: structured binding declaration cannot have type 'int'
   16 |             int[,] LM = new int[M, 2];
      |                ^
a.cc:16:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:16:16: error: empty structured binding declaration
a.cc:16:20: error: expected initializer before 'LM'
   16 |             int[,] LM = new int[M, 2];
      |                    ^~
a.cc:17:16: error: structured binding declaration cannot have type 'int'
   17 |             int[] A = new int[N];
      |                ^~
a.cc:17:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:17:16: error: empty structured binding declaration
a.cc:17:19: error: expected initializer before 'A'
   17 |             int[] A = new int[N];
      |                   ^
a.cc:21:17: error: 'A' was not declared in this scope
   21 |                 A[i] = 0;
      |                 ^
a.cc:26:24: error: expected primary-expression before ']' token
   26 |                 string[] st2 = Console.ReadLine().Split(' ');
      |                        ^
a.cc:27:17: error: 'LM' was not declared in this scope; did you mean 'M'?
   27 |                 LM[i, 0] = int.Parse(st2[0]);
      |                 ^~
      |                 M
a.cc:27:28: error: expected primary-expression before 'int'
   27 |                 LM[i, 0] = int.Parse(st2[0]);
      |                            ^~~
a.cc:28:28: error: expected primary-expression before 'int'
   28 |                 LM[i, 1] = int.Parse(st2[1]);
      |                            ^~~
a.cc:33:30: error: 'LM' was not declared in this scope; did you mean 'M'?
   33 |                 for (int j = LM[i, 0]; j <= LM[i, 1]; j++)
      |                              ^~
      |                              M
a.cc:35:21: error: 'A' was not declared in this scope
   35 |                     A[j-1]++;
      |                     ^
a.cc:41:21: error: 'A' was not declared in this scope
   41 |                 if (A[i] == M)
      |                     ^
a.cc:47:13: error: 'Console' was not declared in this scope
   47 |             Console.WriteLine(allowgate);
      |             ^~~~~~~