Console.Write("请输入等腰三角形的行数:");
int a = Convert.ToInt32(Console .ReadLine ());
for (int b = 0; b < a; b++)
{
for (int c = 0; c < a - b - 1; c++)
{
Console.Write(" ");
}
for (int d = 0; d < 2 * b + 1; d++)
{
Console.Write ("*");
}
Console.WriteLine("\n");
}
Console .ReadKey ();
网友评论