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.
|
|
|
|
#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;
|
|
|
|
|
}
|