public class TuXing {

    public static void main(String[] args) {

        int i, j, k;
        for (i = 1; i <= 5; i++) {
            for (j = 1; j <= 5 - i; j++)
                System.out.print(" ");
            for (k = 1; k <= 2 * i - 1; k++)
                System.out.print("*");
            System.out.println("");
        }

        for (i = 1; i <= 4; i++) {
            for (j = 1; j <= i; j++)
                System.out.print(" ");
            for (k = 1; k <= 9 - 2 * i; k++)
                System.out.print("*");
            System.out.println("");
        }
    }

}

 

posted on 2015-12-03 21:44  halooomo  阅读(450)  评论(0编辑  收藏  举报