c#4-10编程课的答案是什么?
求代码
求代码
2017-07-18
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
for (int x = 1; x <= 7; x++)//循环7行
{
for (int y = 1; y <= 7; y++)//循环7列
{
if (x == y || x + y == 8)//对角线打印O
Console.Write("O");
else
Console.Write(".");//其他位置打印.
}
Console.WriteLine();//换行
}
Console.WriteLine();
}
}
}
}
举报