Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
338255 李明灿 【C2-4】求恰好使s=1+1/2+1/3+…+1/n的值大于X时n的值。 C++ 解答错误 0 2 MS 244 KB 182 2025-08-06 20:55:23

Tests(0/5):


#include<bits/stdc++.h> using namespace std; int n,x,s,i=1; int main(){ cin>>x; double s=0; for(int i=1;i<=x;i++){ s+=1.0*1/i; if(x>s) cout<<i; } return 0; }


测评信息: