Files
python/LuoGu/RuMen/P1035.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

20 lines
342 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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