想想还是解开了。斜对角,一开始都是i = j。反过来是i + j = 8 的都为'0' 其它为'.'
用这个思路解题就好
for (int i = 1; i <= 7; i++)
{
for (int j = 1; j <= 7; j++)
{
if (i == j || i + j == 8)
{
Console.Write("0");
continue;
}
Console.Write(".");
}
Console.WriteLine();
}
用这个思路解题就好
for (int i = 1; i <= 7; i++)
{
for (int j = 1; j <= 7; j++)
{
if (i == j || i + j == 8)
{
Console.Write("0");
continue;
}
Console.Write(".");
}
Console.WriteLine();
}