Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
24298 | 老方 | 级数求和 | C++ | Accepted | 0 MS | 240 KB | 201 | 2023-08-10 12:59:13 |
#include <iostream> using namespace std; int main() { int k, n = 0; float sn = 0; cin >> k; while (sn <= k) { n += 1; sn += 1.0 / n; } cout << n; return 0; }