标签:
1 Static void OutPutStaircase(int n){ 2 //n为楼梯数 3 for(int i = 1; i <= n; i++){ 4 for(int j = 1; j <= n-i; j++){ 5 Console.Write(" "); 6 } 7 for(int k = 1; k <= i; k++){ 8 Console.Write("#"); 9 } 10 Console.WriteLine(""); 11 } 12 } 13 //--------输出如下: 14 # 15 ## 16 ### 17 #### 18 ##### 19 ######
标签:
原文地址:http://www.cnblogs.com/dengyukeji/p/5128796.html