using System;
public class Test
{
public static void Main()
{
var n = Console.ReadLine();
int no = Convert.ToInt32(n);
Pattern print = new Pattern();
print.Diamond(no);
}
}
public class Pattern
{
public void Diamond(int n)
{
int m = n*2;
int dummy=n;
for(int i=0;i<=m;i++)
{
if(i<n)
{
dummy --;
}
else
{
if(i==n)
{
dummy=dummy;
}
else
{
dummy++;
}
}
for(int j=0;j<n;j++)
{
if(j<dummy)
{
Console.Write(" ");
}
else
{
Console.Write("* ");
}
}
Console.WriteLine();
}
}
}
public class Test
{
public static void Main()
{
var n = Console.ReadLine();
int no = Convert.ToInt32(n);
Pattern print = new Pattern();
print.Diamond(no);
}
}
public class Pattern
{
public void Diamond(int n)
{
int m = n*2;
int dummy=n;
for(int i=0;i<=m;i++)
{
if(i<n)
{
dummy --;
}
else
{
if(i==n)
{
dummy=dummy;
}
else
{
dummy++;
}
}
for(int j=0;j<n;j++)
{
if(j<dummy)
{
Console.Write(" ");
}
else
{
Console.Write("* ");
}
}
Console.WriteLine();
}
}
}
3
Comments
Post a Comment