Reply to Reply Post by yangzj1992 (2013-03-23 16:14)
谢谢!!
网友评论(1282555)2013-03-23 16:27
Reply to Reply Post by salthan (2013-03-23 16:15)
谢谢!!
网友评论(1282555)2013-03-23 16:27
Reply to Reply Post by zbl1622 (2013-03-23 16:23)
谢谢!!
网友评论(433847)2013-03-23 16:31
public class for15{
public static void main(String args){
for(int a=1;a <=5;a++)
{
for(int b=1;b <=a;b++)
System.out.print('*');
System.out.println();
}
}
}
每次循环输出a个*后换行
网友评论(966279)2013-03-23 17:51
a是行数,b是星的数量,还少个大括号
----sent from my samsung GT-I9300,Android 4.0.4
网友评论(8013797)2013-03-23 17:57
Reply Post by 云清枫 (2013-03-23 16:31):
public class for15{
public static void main(String args){
for(int a=1;a <=5;a++)
{
for(int b=1;b <=a;b++)
System.out.print('*');
System.out.println();
}
}
}
每次循环输出a个*后换行
强烈建议将line 5的{ 放至line 4的末尾.. 格式不好看会死星人