using System;
namespace test
{
class Program
{
static void Main(string[] args)
{
int Height, Width;
Console.WriteLine("请输入高度:");
if (!int.TryParse(Console.ReadLine(), out Height))
{
Height = 7;
Console.WriteLine("输入有误,高度默认为:{0}\n",Height);
}//接收高度
Console.WriteLine("请输入宽度:");
if(!int.TryParse(Console.ReadLine(), out Width))
{
Width=13;
Console.WriteLine("输入有误,高度默认为:{0}\n",Width);
}//接收宽度
for (int i = 0; i < Height; i++)
{
for (int j = 0; j < Width; j++)
{
Console.Write(!(i == 0 || i == Height - 1) && !(j == 0 || j == Width - 1) ? " " : "0");
}
Console.Write("\n");
}
Console.ReadKey();
}
}
}