我的问题是如何在C#中使用*和'space'制作金字塔?输出将是这样的.
*
* *
* * *
* * * *
* * * * *
Run Code Online (Sandbox Code Playgroud)
我们只需要为此程序使用"for loop".我只知道如何制作这个.
*
**
***
****
*****
Run Code Online (Sandbox Code Playgroud)
我做了一个这样的程序:
static void Main(string[]args)
{
int i=o;
int j=o;
for(i=5;1>=1;i--)
for(j=1;j<=5;j++)
{
Console.Write("*");
}
Console.WriteLine(" ");
}
Run Code Online (Sandbox Code Playgroud)
当谈到金字塔时我很困惑,因为它包含空格.谢谢你的帮助!
c# ×1