哈哈,這樣也行!
for(int x=1;x<=7;x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for(int y=1;y<=7;y++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if(x==y||x+y==8)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ?Console.Write("o");?
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write(".");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();
? ? ? ? ? ? }
2020-01-18
2020-01-07
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? for (int y = 1; y <= 7; y++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for (int x = 1;x<=7; x++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (x + y == 8)
? ? ? ? ? ? ? ? ? ? Console.Write("O");
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? else if (x - y == 0)
? ? ? ? ? ? ? ? ? ? Console.Write("O");
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? Console.Write('.');
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();//換行
? ? ? ? ? ? }?
? ? ? ? ? ??
? ? ? ? ? ??
? ? ? ? }
? ? }
}
2020-01-01
?for(int y=1;y<=7;y++)
??????????? {
??????????????? for(int x=1;x<=7;x++)
??????????????? {
??????????????????? if(x==y||x==7-(y-1))
??????????????????? Console.Write('O');
??????????????????? else
??????????????????? Console.Write('.');
???????????????????
??????????????? }
??????????? Console.WriteLine();
?????????????
??????????? }
2019-12-28
or(int x=1;x<=7;x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for(int y=1;y<=7;y++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if(x==y||x+y==8)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ?Console.Write("o");?
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write(".");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.Write("\n");
? ? ? ? ? ? }