int n = 5;
for (int i = 0; i < n; i++)
{
for (int k = n - 1; k >= i; k--)
{
Console.Write("王");
}
if (i == n - 1) //if (i < n - 1)//定位最后光标关键语句
break;
{
Console.WriteLine();
for (int j = 0; j <= i; j++)
{
Console.Write(" ");
}
}
}
Console.ReadKey();
写了一段,实在不会了:int i = 0, k = 5;while (i < k){i++;Console.Write("王");}Console.ReadLine();
用While实现的:
int i = 0, n = 5;满意请采纳。