折纸---珠穆朗玛问题----简单for 循环

一张纸的厚度大约是0.08mm,对折多少次之后能达到珠穆朗玛峰的高度(8848.13米)?

package com.zuoye.test;

public class Zhezhi {
public static void main(String[] args)
{
int i=1;
double h=0.08;
//计算折叠厚度

for(i=1;h<8848130;i++)
{
h=h*2;
}
System.out.println("折叠第"+i+"次后可以超过珠穆朗玛!");


}
}

原文地址:https://www.cnblogs.com/20gg-com/p/5866665.html