編譯器明明已經(jīng)通過了,為什么提交代碼卻顯示不正確呢?
? ? ? ? ? ? for(int x=1;x<=7;x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for(int y=1;y<=7;y++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if(y==x||8==x+y)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write('0');
? ? ? ? ? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? Console.Write('.');
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();
? ? ? ? ? ? }
? ? ? ? ? ? //請完善代碼
2016-04-06
是大寫的O,不是0
2016-04-05
代碼應(yīng)該沒有問題的,就是要把“0”改成“o”,我也是試了好多次才發(fā)現(xiàn)的。
2016-04-03
for (int x = 1; x <= 7; x++)//循環(huán)7行
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for (int y = 1; y <= 7; y++)//循環(huán)7列
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (x == y || x + y == 8)//對角線打印O
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write("O");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write(".");//其他位置打印.
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();//換行
? ? ? ? ? ? }