level 2
mu5003893
楼主
static void Main(string[] args)
{
Console.WriteLine("input number");
int x = Convert.ToInt32(Console.ReadLine());
int i,y;
string ss;
ss = "* ";
for (i = x-1; i >= 0; i--)
{
Console.Write(new string(' ',i));
for (y = 1; y <= x; y++)
{
Console.Write(ss, y);
}
Console.WriteLine();
}
}
为何负责控制"* "数量的y不起作用呢,明明 i 就起作用了啊,是哪里写错了。我才学了3天,求指导~!
2016年02月04日 04点02分
1
{
Console.WriteLine("input number");
int x = Convert.ToInt32(Console.ReadLine());
int i,y;
string ss;
ss = "* ";
for (i = x-1; i >= 0; i--)
{
Console.Write(new string(' ',i));
for (y = 1; y <= x; y++)
{
Console.Write(ss, y);
}
Console.WriteLine();
}
}
为何负责控制"* "数量的y不起作用呢,明明 i 就起作用了啊,是哪里写错了。我才学了3天,求指导~!