int a = 5; //总共五行
for (int i = a; i >=1 ; i--)
{
for (int h = 1; h<=a-i ; h++)
{
Console.Write(" ");
}
for (int j = 0; j <2*i-1 ; j++)
{
Console.Write("*");
}
Console.WriteLine("\n"); //换行
}
Console.ReadKey();
输出结果:
*******
*****
***
*