c++求助题!

P1423 小玉在游泳

ans设置成浮点
by BetaCutS @ 2022-02-20 15:30:14


将ans开成**float**就可以了
by arrow_king @ 2022-02-20 15:53:18


float ans 就行
by hanyoulin @ 2022-03-18 13:18:21


ans设为float ```cpp #include <bits/stdc++.h> using namespace std; int main (){ double x,ans; int i=1; scanf("%lf",&x); ans=2; while(ans<=x){ ans+=ans/100*98; i++; } cout<<i<<endl; return 0; } ```
by I_am_zzm @ 2022-06-17 17:21:27


|