利用JAVA写一张纸折叠珠穆拉玛峰高度
public class zhumulama {
public static void main(String[] args) {
double height = 8848860;
double zhi = 0.1;
int count = 0;
while(zhi <= height){
zhi*=2;//每次折完厚度
count++;//计数
}
System.out.println("一共需要折"+count+"次");
System.out.println("纸张最终的厚度"+zhi);
}
}