各位大侠好~
如何输出如下的图形?请帮忙~谢谢~
1
12
123
1234
12345
123456

解决方案 »

  1.   

    public class test{
    public static void main(String []args){
    for(int i=0;i<7;i++){
    for(int j=1;j<i+1;j++){
    System.out.print(j);
    }
    System.out.println();
    }
    }
    }
      

  2.   

    不好意思,误导人了,test写成Test
      

  3.   

    public class Test{
        public static void main(String []args){
            for(int i=0;i<7;i++){
                for(int j=1;j<i+1;j++){
                    System.out.print(j);
                }
                System.out.println();
            }
        }
    }