我记得我做过类似的题目,你可以改下就成
int i, j, k;
for (i = 1; i <= 4; i++)
{
for (j = 1; j <= 4 - i; j++)
Console.Write (" ");
for (k = 1; k < 2 * i; k++)
Console.Write ("*");
Console.WriteLine ();
}
for (i = 3; i > 0; i--)
{
for (j = 3; j >= i; j--)
Console.Write (" ");
for (k = 1; k < 2 * i; k++)
Console.Write ("*");
Console.WriteLine ();
}
Console.ReadKey(); |