為什么還是沒有運行成功?
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? //請完善代碼
? ? ? ? ? ? for(int i = 0;i<7;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for(int j = 0;j<7;j++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if(j==i||i+j==6)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write("0");
? ? ? ? ? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? Console.Write(".");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2019-03-28
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 || x == 8 - y)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write("0");
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write(".");
? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? if (x == 7)
? ? ? ? ? ? ? ? ? ? { Console.Write("\r\n"); }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? //請完善代碼
? ? ? ? ? ? }
? ? ? ? }
? ? }
}加上\r\n換行符
2019-03-25
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++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for(int y=7;y>=1;y--)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if(x+y==8){
? ? ? ? ? ? ? ? ? ? ? ? Console.Write('o');
? ? ? ? ? ? ? ? ? ? }else if(x==y){
? ? ? ? ? ? ? ? ? ? ? ? Console.Write('o');
? ? ? ? ? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? ? ? ? ? Console.Write('.');
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2019-03-17
判定有問題,應該是i+j==8
2019-03-05
小寫的字母o,不是數(shù)字0
2019-03-05
代碼本身沒有問題,是你把大寫的O看成了零0
2019-03-03
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? //請完善代碼
? ? ? ? ? ? for (int a = 0; a < 7; a ++){
? ? ? ? ? ? ? ? for (int b = 0; b < 7; b++){
? ? ? ? ? ? ? ? ? ? var up = a;
? ? ? ? ? ? ? ? ? ? var down = 6 - a;
? ? ? ? ? ? ? ? ? ? if (b == up || b == down){
? ? ? ? ? ? ? ? ? ? ? ? Console.Write('o');
? ? ? ? ? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write('.');
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
我覺得你可以參考一下我的代碼。