要輸出這種反序的三角,請高手幫一下*********************...
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 關注
- 1683 瀏覽
添加回答
舉報
0/150
提交
取消