| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 443174 | 王璟源 | 【C2-4】求恰好使s=1+1/2+1/3+…+1/n的值大于X时n的值。 | C++ | 通过 | 100 | 1 MS | 240 KB | 169 | 2026-06-03 19:36:59 |
#include <bits/stdc++.h> using namespace std; int main(){ float x,s=0; cin>>x; int i=1; while(s<=x){ s=s+1.0/i; i++; } cout<<i-1; return 0; }