金字塔程序

//金字塔程序:
public class Jinzita {

    public static void main(String[] args) {
        for (int a = 1; a < 10; a++) {
            for (int b = 0; b < (9 - a); b++) {
                System.out.print(" ");
            }
            for (int b = 1; b <= a; b++) {
                System.out.print(b);
            }
            for (int b = (a - 1); b > 0; b--) {
                System.out.print(b);
            }
            System.out.println();
        }
    }
}
原文地址:https://www.cnblogs.com/chaohi/p/2330372.html