最赞回答 / 一念征途
你好,按你上面的代码运行的话 ,for循环,只运行了7次,就退出了,感觉你应该想要循环8次,8次和7次的代码的不同 就在于for (int i = 0; i &/im 8; ++i) 和for (int i = 0; i &第一点 8; i++),重点是++i 和...
2017-06-02
namespace Test
{
for (int y = 1; y <= 7; y--)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
{
for (int y = 1; y <= 7; y--)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
2017-06-01
for(int x=-3;x<=3;x++)
{
for(int y=-3;y<=3;y++)
{
if(Math.Abs(x)==Math.Abs(y))
Console.Write('O');
else
Console.Write('.');
}
Console.WriteLine();
}
大写字母O,太坑了,不是数字0
{
for(int y=-3;y<=3;y++)
{
if(Math.Abs(x)==Math.Abs(y))
Console.Write('O');
else
Console.Write('.');
}
Console.WriteLine();
}
大写字母O,太坑了,不是数字0
switch (job)
{
case "局长": Console.Write("发双黄月饼"); break;
case "处长": Console.Write("发蛋黄月饼"); break;
case "科长": Console.Write("发枣泥月饼");
default: Console.Write("发五仁月饼"); break;
}
}
{
case "局长": Console.Write("发双黄月饼"); break;
case "处长": Console.Write("发蛋黄月饼"); break;
case "科长": Console.Write("发枣泥月饼");
default: Console.Write("发五仁月饼"); break;
}
}
2017-05-26