标签:test blog mamicode oid loading log 图片 demo image
public class TestDemo {
    public static void main(String[] args) {
        //打印三角形
        for (int i = 1; i <= 5; i++) {
            for (int j = 5; j >= i; j--) {
                System.out.print(" ");
            }
            for (int j = 1;j <= i ;j++){
                System.out.print("*");
            }
            for (int j = 1; j < i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
运行结果如下:

标签:test blog mamicode oid loading log 图片 demo image
原文地址:https://www.cnblogs.com/guoguodong/p/14806693.html