YYAN_ZU @ 2024-05-06 19:56:41
#include<iostream>
using namespace std;
const int N=1010;
double a[N],sum[N];
int main()
{
int k,i;
cin>>k;
for(i=1;;i++)
{
a[i]=1.0/i;
sum[i]=sum[i-1]+a[i];
if(sum[i]>k)
break;
}
cout<<i;
return 0;
}
by zhang8031 @ 2024-05-26 14:13:36
long double 是个好东西,可是你不要