Language: C++

using System;

namespace test01
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string str = Console.ReadLine();
                string[] ArryNum = str.Split();
                int em = int.Parse(ArryNum[0]); //中間試験
                int te = int.Parse(ArryNum[1]); //期末試験
                int re = int.Parse(ArryNum[2]); //再試験
                int sum = em + te;

                if (em == -1 && te == -1 && re == -1)
                {
                    break;
                }
                else if (sum >= 80)
                {
                    Console.WriteLine("A");
                }
                else if (sum >= 65)
                {
                    Console.WriteLine("B");
                }
                else if (sum >= 50)
                {
                    Console.WriteLine("C");
                }
                else if (sum >= 30)
                {
                    if (re >= 50)
                    {
                        Console.WriteLine("C");
                    }
                    else
                    {
                        Console.WriteLine("D");
                    }
                }
                else
                {
                    Console.WriteLine("F");
                }
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:51:6: error: expected ';' after class definition
   51 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void test01::Program::Main(int*)':
a.cc:11:17: error: 'string' was not declared in this scope
   11 |                 string str = Console.ReadLine();
      |                 ^~~~~~
a.cc:12:24: error: expected primary-expression before ']' token
   12 |                 string[] ArryNum = str.Split();
      |                        ^
a.cc:13:26: error: expected primary-expression before 'int'
   13 |                 int em = int.Parse(ArryNum[0]); //中間試験
      |                          ^~~
a.cc:14:26: error: expected primary-expression before 'int'
   14 |                 int te = int.Parse(ArryNum[1]); //期末試験
      |                          ^~~
a.cc:15:26: error: expected primary-expression before 'int'
   15 |                 int re = int.Parse(ArryNum[2]); //再試験
      |                          ^~~
a.cc:24:21: error: 'Console' was not declared in this scope
   24 |                     Console.WriteLine("A");
      |                     ^~~~~~~
a.cc:28:21: error: 'Console' was not declared in this scope
   28 |                     Console.WriteLine("B");
      |                     ^~~~~~~
a.cc:32:21: error: 'Console' was not declared in this scope
   32 |                     Console.WriteLine("C");
      |                     ^~~~~~~
a.cc:38:25: error: 'Console' was not declared in this scope
   38 |                         Console.WriteLine("C");
      |                         ^~~~~~~
a.cc:42:25: error: 'Console' was not declared in this scope
   42 |                         Console.WriteLine("D");
      |                         ^~~~~~~
a.cc:47:21: error: 'Console' was not declared in this scope
   47 |                     Console.WriteLine("F");
      |                     ^~~~~~~