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 }

Java实现金字塔:1 212 32123 4321234 543212345.....

 

上一篇:Atcoder Beginner Contest 212 G,H题解


下一篇:python输出所有三位数的回文数