[NOIP 2002 普及组 T1] 级数求和
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n = 0, k;
double s = 0;
cin >> k;
while (s <= k)
{
n++;
s += 1.0 / n;
}
cout << n << endl;
return 0;
}#include <bits/stdc++.h>
using namespace std;
int main()
{
int n = 0, k;
double s = 0;
cin >> k;
while (s <= k)
{
n++;
s += 1.0 / n;
}
cout << n << endl;
return 0;
}