Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
439405 陈梓霖 【C2-2】 编程求1+1/2+1/3+...+1/n C++ 通过 100 2 MS 248 KB 187 2026-05-07 16:40:52

Tests(5/5):


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


测评信息: