我应该给这个输出不完整的输出与while循环
* * * * *
* * * * *
* * * * * *
* * * * *
等等等等5个itirations 但它只显示第2输出
这里是我的代码
public class itiration {
public static void main(String args[]){
int counter1 = 1;
int counter2 = 1;
int counter3 = 1;
while(counter1<=5)
{
while(counter2<=5)
{
System.out.print("* ");
System.out.print(" ");
counter2++;
}
System.out.println();
while(counter3<=5)
{
System.out.print(" ");
System.out.print("* ");
counter3++;
}
System.out.println();
counter1++;
}
}
}
这不是作业
在输出采样,第四行有六个* S: 试试这个。这是一个错字还是应该是这样的? – 2011-05-19 04:52:17
示例序列中的下一行应该是什么?我没有看到任何明显的模式。 – Asaph 2011-05-19 04:53:02