只要指定条件为 true,循环就可以一直执行代码块.
while 循环会在指定条件为真时循环执行代码块。
语法:
初始化条件
while(判断循环结束条件){
run this code
}
例:
do{ 需要执行的代码}while (条件);