public class teste {
public static void main(String[] args) {
/*double n = 0;
while(Math.pow(2,n)*0.1 < 8844430){
n++;
}*/
/*double a = Math.log(88444300);
double b = Math.log(2);
double c = a/b;
int res = (int)c + 1;
System.out.println("需折叠:" + res + "次");
*/
/*int count = 0;
double paper = 0.1;
while (paper < 8844430) {
paper *= 2;
count++;
}
System.out.println(count);*/
int n=1; //位运算符
while((88444300 >> n ) != 0){ //二进制右移
n++;
}
System.out.println(n);
}
}
题目
世界最高山峰是珠穆朗玛峰(8844.43m=8844430mm),假如我有一张足够大的纸,它的厚度是0.1mm。请问我折叠多少次,可以折成珠穆朗玛峰的高度?