> 其他 >
public class test{
\x05public static void main(String args[] ){
\x05int x=0;
\x05\x05int y=0;
\x05while (x4){
y=y-1;}
System.out.print(x + ""+y+" ");
x=x+1;
\x05}
\x05}
\x05
}
02 14 25 36 47
人气:291 ℃ 时间:2020-04-15 04:26:33
解答
这是JAVA代码.public class test{\x05public static void main(String args[] ){\x05int x=0;\x05int y=0;\x05while (x4) { //若果y大于4,就y减少1.y=y-1;}System.out.print(x + ""+y+" "); //输出x和y的值,一起输出...假设上面的条件中有X 那是不是第一次输出完了的x的值也要在x=x+1加上1?System.out.print(x + ""+y+" ");x=x+1;两个语句是相邻的,没有什么跳转,所以每次输出xy后,下一步就是 x = x+1 进行x自增。但不是 x = x+1 再加1.x = x + 1 而已。
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版