设纸的厚度为0.01m,珠峰高度为8848m,为简便,都换算为cm
class WhileTese {
public static void main(String[] args) {
int count = 0;
int end = 884800;
int start = 1;
while(start<end) {
count++;
start *= 2;
System.out.println("第"+count+"次厚度是"+start);
}
System.out.println("要叠"+count+"次");
}
}
|
|