赞
踩
- // 一张纸的厚度大约是0.1mm,对折多少次之后能达到珠穆朗玛峰的高度(8844.43米)
- public class ForTest {
- public static void main(String[] agrs){
- int i = 1;
- double paper = 0.1;
- int zf = 8844430;
- for(i=1; paper <= zf; i++) {
- paper = paper*2;
- }
- System.out.println("需要折叠:" + i + "次");
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。