日期:2014-05-20  浏览次数:20641 次

新手求个程序
使用while 或者do-while打出
*
**
***
****
*****
******
*******
********
**********

刚学,实在弄不出,麻烦高手给个程序,谢谢了

------解决方案--------------------
Java code
package mars.test;

public class Test {

    /**
     * @param args
     */
    public static void main(String[] args) {
        int i=0;
        while(i++<10)
        {
           int j=0;
           while(j++<i)
           {
             System.out.print("*");
           }
           System.out.println("\n");
        }

    }

}