本帖最后由 allyvin 于 2012-02-22 19:38:00 编辑

解决方案 »

  1.   

    开来我挺闲的
    public class TestPrint {
    public static void main(String[] args) {
    int n = 6;
    int m = 5;
    String 1 = "* ";
    String 2 = "   * * *";
    String blank = " ";
    // ---------------------------------
    for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - i - 1; j++) {
    System.out.print(blank);
    }
    for (int j = 0; j < i + 1; j++) {
    System.out.print(1);
    }
    System.out.println();
    }
    // ---------------------------------
    for (int i = 0; i < m; i++) {
    System.out.println(2);
    }
    }
    }