using System;
public class Test
{
public static void Main()
{
var number = Console.ReadLine();
int n = Convert.ToInt32(number);
PrintPattern print = new PrintPattern();
print.Printpyramid(n);
}
}
public class PrintPattern
{
public void Printpyramid(int n)
{
int m = n/2;
int dummy=1;
for(int i=0;i<n;i++)
{
for(int j=n;j>i;j--)
{
if(i!=0 && i!=n-1 && i!=n-2 && j!=n && j!=dummy)
{
Console.Write(" ");
}
else
{
Console.Write("*");
}
}
dummy=dummy+1;
Console.WriteLine();
}
}
}
public class Test
{
public static void Main()
{
var number = Console.ReadLine();
int n = Convert.ToInt32(number);
PrintPattern print = new PrintPattern();
print.Printpyramid(n);
}
}
public class PrintPattern
{
public void Printpyramid(int n)
{
int m = n/2;
int dummy=1;
for(int i=0;i<n;i++)
{
for(int j=n;j>i;j--)
{
if(i!=0 && i!=n-1 && i!=n-2 && j!=n && j!=dummy)
{
Console.Write(" ");
}
else
{
Console.Write("*");
}
}
dummy=dummy+1;
Console.WriteLine();
}
}
}
Comments
Post a Comment