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