菱形

package lianxi;

public class Lingxing {

    public static void main(String[] args) {

        int m = 10;

        for (int i = 1; i <= m; i++) {
            for (int j = m - 1; j >= i; j--) {
                System.out.print(" ");
            }
            for (int j = 1; j <= i; j++) {
                System.out.print("b");
            }
            for (int j = 2; j <= i; j++) {
                System.out.print("c");
            }

            System.out.println();
        }
        for (int i = m; i >= 1; i--) {

            for (int j = m; j >= i; j--) {
                System.out.print(" ");
            }
            for (int j = 2; j <= i; j++) {
                System.out.print("e");
            }

            for (int j = 3; j <= i; j++) {
                System.out.print("f");
            }

            System.out.println();

        }
    }

}

 

posted @ 2015-12-05 08:32  刘某人丶  阅读(148)  评论(0编辑  收藏  举报