普罗旺斯 @ 2017-08-17 17:57:19
#include<bits/stdc++.h>
#include<math.h>
#include<algorithm>
#include<cstdio>
#include<fstream>
using namespace std;
int k,n=0;
float s=0.0;
void snk()
{
cin>>k;
while(k<=s)
{
n++;
s=s+1.0/n;
}
cout<<n;
}
int main()
{
snk();
return 0;
}
by JacderZhang @ 2017-08-24 14:51:22
精度问题
float 改double