using System;
public class Test
{
public static void Main()
{
var length = Console.ReadLine();
int l = Convert.ToInt32(length);
var breadth = Console.ReadLine();
int b = Convert.ToInt32(breadth);
PrintRectangle print = new PrintRectangle();
print.PrintHollowRectangle(l,b);
}
}
public class PrintRectangle
{
public void PrintHollowRectangle(int l,int b)
{
for(int i=0;i<b;i++)
{
for(int j=0;j<l;j++)
{
if(i!=0 && i!=b-1 && j!=0 && j!=l-1)
{
Console.Write(" ");
}
else
{
Console.Write(" * ");
}
}
Console.WriteLine();
}
}
}
INPUT
5
4
OUTPUT
* * * * * * * * * * * * * *
Comments
Post a Comment