younger_111 @ 2023-12-26 15:41:36
代码
#include<iostream>
using namespace std;
int main()
{
int k;
cin >> k;
double n=1,s=0;
while (s <= k)
{
s = s + 1/n;
n = n + 1;
}
cout << n;
return 0;
}
by Syz2012 @ 2023-12-27 16:44:26
把s=0改成s=1