![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 int a, b, c;// a5 设置数列总数 2 for (a = 1; a < 8; a++) {// a5 设置数列总数 总共20行 3 for (b = 8; b > a; b--) {// b5设置左上角空白 第一行5个以此类推至0为止 4 System.out.print(" ");} 5 for (c = 1; c < 2 * b - 1; c++) {// c5设置标记星每行出现行数+1 6 System.out.print("*");} 7 System.out.println("*");} 8 System.out.print("**************"); 9 int q, w, e; 10 for (q = 1; q <9;q++) { 11 System.out.println("*"); 12 13 for (w = 0; w < q; w++) { 14 System.out.print(" "); 15 } 16 for (e = 15; e > 2 * w + 1; e--) { 17 System.out.print("*"); 18 } 19 }