Java2024/src/Example12.java
2024-09-02 21:30:59 +08:00

10 lines
305 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

public class Example12 {
public static void main(String[] args) {
int x = 5; // 定义变量x初始值为1
while (x <= 4) { // // 循环条件
System.out.println("x = " + x); // 条件成立打印x的值
x ++; // x进行自增
}
}
}