基本格式:
while(条件判断语句){
循环体语句;
}
完整格式
初始化语句:
while (条件判断语句){
循环体语句;
条件控制语句;
}
import java.util.Scanner;
public class hello {
public static void main(String[] args) {
int j=1;
while (j<=5){
System.out.println("hello");
j++;
}
}
}
import java.util.Scanner;
public class hello {
public static void main(String[] args) {
int count = 0;
double paper = 0.1;
int zf = 9999999;
while (paper <= zf){
paper *= 2;
count++;
}
System.out.println(count);
}
}