for (int n = 0; n < 7; n++)
{
for (int i = 0; i < 7; i++)
{
string text = i == n || i == 6-n ? "O" : ".";
Console.Write(text);
}
Console.WriteLine();
}
{
for (int i = 0; i < 7; i++)
{
string text = i == n || i == 6-n ? "O" : ".";
Console.Write(text);
}
Console.WriteLine();
}
这个能完成作业
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
//Console.WriteLine();//换行
}
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
//Console.WriteLine();//换行
}
2017-09-02
这是和图上一样的结果
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
2017-09-02
if (salary > price && salary - price >= 200){
Console.Write("买手机没问题,还有多!");
}
else if (salary > price){
Console.Write("还行吧,买了吃西北风");
}
else{
Console.Write("买个篮子");
}
Console.Write("买手机没问题,还有多!");
}
else if (salary > price){
Console.Write("还行吧,买了吃西北风");
}
else{
Console.Write("买个篮子");
}