Java实现金字塔:1 212 32123 4321234 543212345.....
作者:互联网
1 public class demo1 { 2 3 public static void main(String[] args) { 4 // TODO Auto-generated method stub 5 6 for (int i = 1; i <=9; i++) { 7 for(int a=i;a<9;a++) { 8 System.out.print(" "); 9 } 10 for (int j = i; j >=1; j--) { 11 System.out.print(j); 12 13 } 14 for (int s = 2; s <=i; s++) { 15 System.out.print(s); 16 17 } 18 System.out.println(); 19 20 } 21 22 } 23 24 }
标签:4321234,212,int,System,32123,.....,static,public 来源: https://www.cnblogs.com/itszx/p/15611938.html