From 6dcb3facc81312cfc6f74ac00a00728ef3b32ba6 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 2 Oct 2021 09:46:25 +0800 Subject: [PATCH] =?UTF-8?q?P1035=20[NOIP2002=20=E6=99=AE=E5=8F=8A=E7=BB=84?= =?UTF-8?q?]=20=E7=BA=A7=E6=95=B0=E6=B1=82=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R58891633 --- Luogu/problem/P1035/P1035.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Luogu/problem/P1035/P1035.cpp diff --git a/Luogu/problem/P1035/P1035.cpp b/Luogu/problem/P1035/P1035.cpp new file mode 100644 index 00000000..ea91b573 --- /dev/null +++ b/Luogu/problem/P1035/P1035.cpp @@ -0,0 +1,15 @@ +#include + +using namespace std; + +int k, n; +double s; + +int main() { + cin >> k; + while (s <= k) { + s += 1.00 / ++n; + } + cout << n << endl; + return 0; +}