0
1 0 1
0 1 0 1 0
1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0
class Program
{ static void Main(string[] args)
{
for (int row = 1; row <= 5; row++)
{
for (int space = 5; space >= row; space--)
{
Console.Write(" ");
}
for (int coll = 1; coll <= (row * 2) - 1; coll++)
{ if ((coll + row) % 2 == 0)
{
Console.Write("0");
} else
{
Console.Write("1");
}
}
Console.WriteLine();
}
Console.ReadLine();
}
}
No comments:
Post a Comment