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