读书人

新手求个程序,该如何解决

发布时间: 2012-01-14 20:02:35 作者: rapoo

新手求个程序
使用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");        }    }} 

读书人网 >Java相关

热点推荐