这题可以不用for循环,但也可以用
(亲测AC)
```
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
double k=2.0,x,l=0.0;
cin>>x;
for(int i=1;;i++){
l+=k;
if(l>x||l==x){
cout<<i;
break;
}
k*=0.98;
}
return 0;
}
by NOIP__qwq__ @ 2024-07-14 11:19:32
666
by NOIP__qwq__ @ 2024-07-14 11:27:47
感谢大佬!!!
by liyifanglan @ 2024-07-14 12:18:17