public class 珠穆朗玛峰折纸 |
{ |
public static void main(String[] args) |
{ |
double paper = 0.01 ; |
double height = 8848 ; |
int count = 0 ; |
while ( true ){ |
paper=paper* 2 ; |
count++; |
if (paper>height){ |
break ; |
} |
|
} |
System.out.println( "一共折叠了" +count+ "次,目前纸张这么高" +paper); |
|
|
} |
} |
中级程序员
by: LinKin 发表于:2019-11-17 15:23:39 顶(0) | 踩(0) 回复
可以
回复评论