1.while循环实现打印1到10

while循环实现打印1到10

/**
 * [说明]:while循环实现打印1到10
 * @author aeon
 */
public class TestWhile {
    public static void main(String[] args) {
        int i = 1;// 变量初始化
        while (i <= 10) {// 条件
            System.out.println(i++);// 循环体及迭代
        }
    }
}

结果截图:

  

猜你喜欢

转载自www.cnblogs.com/aeon/p/9827011.html