class Program
{
static void Main(string[] args)
{
int n = 5;
int space;
for (int i = 1; i <= n; i++)
{
for (space = 1; space <= (n - i); space++)
{
Console.Write(" ");
}
for (int j = 1; j <= i; j++)
{
Console.Write(j);
}
for (var k = (i - 1); k >= 1; k--)
{
Console.Write(k);
}
Console.WriteLine();
}
}
}
No comments:
Post a Comment