Language: C++

using System;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var read = Console.ReadLine();
                var temp_string = read.Split(' ');

                int H = int.Parse(temp_string[0]), W = int.Parse(temp_string[1]);

                if (H == 0 && W == 0)
                    break;

                if(H!=0)
                {
                    for(int i=0;i<W;i++)
                    {
                        Console.Write("#");
                    }
                    Console.WriteLine();

                    for (int i = 0; i < H - 2;i++ )
                    {
                        Console.Write("#");
                        for(int r = 0 ;r < W-2;r++)
                        {
                            Console.Write(" ");
                        }
                        Console.Write("#");
                        Console.WriteLine();

                    }


                        if (H > 1)
                        {
                            for (int i = 0; i < W; i++)
                            {
                                Console.Write("#");
                            }
                            Console.WriteLine();
                        }
                        Console.WriteLine();
                }
            }

        }
    }
}

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:53:6: error: expected ';' after class definition
   53 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void AOJ::Program::Main(int*)':
a.cc:11:17: error: 'var' was not declared in this scope
   11 |                 var read = Console.ReadLine();
      |                 ^~~
a.cc:12:21: error: expected ';' before 'temp_string'
   12 |                 var temp_string = read.Split(' ');
      |                     ^~~~~~~~~~~
a.cc:14:25: error: expected primary-expression before 'int'
   14 |                 int H = int.Parse(temp_string[0]), W = int.Parse(temp_string[1]);
      |                         ^~~
a.cc:16:31: error: 'W' was not declared in this scope
   16 |                 if (H == 0 && W == 0)
      |                               ^
a.cc:21:35: error: 'W' was not declared in this scope
   21 |                     for(int i=0;i<W;i++)
      |                                   ^
a.cc:23:25: error: 'Console' was not declared in this scope
   23 |                         Console.Write("#");
      |                         ^~~~~~~
a.cc:25:21: error: 'Console' was not declared in this scope
   25 |                     Console.WriteLine();
      |                     ^~~~~~~
a.cc:30:44: error: 'W' was not declared in this scope
   30 |                         for(int r = 0 ;r < W-2;r++)
      |                                            ^
a.cc:42:49: error: 'W' was not declared in this scope
   42 |                             for (int i = 0; i < W; i++)
      |                                                 ^