class exercise4{
public static void main(String[] args){
int count = 0; //设置计数器
for(float a =0.001f;a<=8848;a*=2){
count++;
}
System.out.println(count);
}
}
我是这么做的
class Demo {
public static void main(String[] args) {
int a = 8848;
int count = 0;
double b = 0.001;
do {
b = b*2;
//System.out.println(b);
count++;
//System.out.println("count="+count);
}
while (a > b );
System.out.println("count="+count);
}
}