i 又作为距离,又作为步长。
by haraki @ 2023-10-14 00:47:06
你应该使用两个变量分别记录已游的长度和每次游的长度。
by haraki @ 2023-10-14 00:47:47
1、用double
2、建议用while循环
```c
#include <iostream>
using namespace std;
int main(){
double a,b=0,c=2;
cin>>a;
double sum=1;
a-=c;
while (a>0){
a-=c*0.98;
c*=0.98;
sum++;
}
cout<<sum;
}
```
by penguin_is_cool @ 2023-10-18 21:47:43