mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 23:48:48 +00:00
P1035 [NOIP2002 普及组] 级数求和
R58891633
This commit is contained in:
parent
a9ea25dbd1
commit
6dcb3facc8
15
Luogu/problem/P1035/P1035.cpp
Normal file
15
Luogu/problem/P1035/P1035.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int k, n;
|
||||||
|
double s;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cin >> k;
|
||||||
|
while (s <= k) {
|
||||||
|
s += 1.00 / ++n;
|
||||||
|
}
|
||||||
|
cout << n << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user