要输出这种反序的三角,请高手帮一下*********************...
2 回答
慕码人8056858
TA贡献1803条经验 获得超6个赞
namespace xx{
class xx{
static void Main(){
Console.WriteLine("本程序用于倒金字塔的输出");
Console.WriteLine("请输入倒金字塔的塔高:");
int hang=Convert.ToInt32(Console.ReadLine());
int k=hang,i=1;
while(i<=hang){
int j=1;
while(j<=k-1){
Console.Write("\0");
j++;
}
int x=1;
while(x<=2*i-1){
Console.Write("*");
x++;
}
Console.Write("\n");
i++;
k--;
}
}
相信我绝对没问题
- 2 回答
- 0 关注
- 1652 浏览
添加回答
举报
0/150
提交
取消