6
2025-09-23 21:19:27
发布于:浙江
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x,k=2,t=0,s=0;
cin>>x;
while(1)
{
s=s+k;
k=k*0.98;
t++;
if(s>=x)
{
break;
}
}
cout<<t;
return 0;
}
这里空空如也
2025-09-23 21:19:27
发布于:浙江
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x,k=2,t=0,s=0;
cin>>x;
while(1)
{
s=s+k;
k=k*0.98;
t++;
if(s>=x)
{
break;
}
}
cout<<t;
return 0;
}
这里空空如也
提交答案之后,这里将显示提交结果~
有帮助,赞一个