我的教授让我们在课堂上这样做,看到这些输出我非常困惑。
是这样的
(x + " " + y + " " + z)
平均值添加所有3个变量
if (y > z)
?输出对我来说毫无意义。
public class Practice
{
public static void main (String[] args)
{
int x=10, y=11, z=3;
do
{
System.out.println(x + " " + y + " " + z);
if (y > z)
{
y = y-5;
}
else
{
y = y + 3;
}
x = x - 2;
} while (x > 0);
System.out.println("Bye");
}
}
OUTPUT:
10 11 3
8 6 3
6 1 3
4 4 3
2 -1 3
Bye