Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
285386 陈思陶 【C2-2】 编程求1+1/2+1/3+...+1/n C++ 通过 100 1 MS 248 KB 185 2024-07-25 19:06:49

Tests(5/5):


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


测评信息: