素荼 @ 2017-10-27 20:12:45
#include <bits/stdc++.h>
using namespace std;
float s,k;
long long n;
main ()
{
cin>>k;
s=0;n=0;
while(k>=s){
n++;
s=s+(1.0/n);
}
cout<<n;
return 0;
}
测试点3和测试点5错了
by _LiM @ 2017-11-03 20:26:44
不能用float 精度不够 用double