来自:https://www.luogu.com.cn/problem/P1035
#include<iostream>
using namespace std;
int main(){
int n=0,k;
double s=0.0;
cin>>k;
do{
n++;
s=s+1.0*1/n;
}while(s<=k);
cout<<n;
return 0;
}
来自:https://www.luogu.com.cn/problem/P1035
#include<iostream>
using namespace std;
int main(){
int n=0,k;
double s=0.0;
cin>>k;
do{
n++;
s=s+1.0*1/n;
}while(s<=k);
cout<<n;
return 0;
}