h15980393816 @ 2022-11-15 15:05:21
#include<iostream>
using namespace std;
int main()
{
int k;
double n,s=0;
cin>>k;
for(n=1;s>k;n++)
{
s+=1/n;
}
n--;
cout<<n;
return 0;
}
by OldDriverTree @ 2022-11-15 15:20:46
循环条件应该是s<k , 否则连循环都进不了去