You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
323 B

2 years ago
#include<bits/stdc++.h>
using namespace std;
int main() {
int K;
cin>>K;
double S=0.00000;
//知识点1INT_MAX
//知识点2整数转浮点数
for(int n=1; n<INT_MAX; n++) {
S+=1/(n*1.0);
if(S>K) {
cout<<n<<endl;
break;
}
}
return 0;
}