Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
280999 冯琦浩 【C2-2】 编程求1+1/2+1/3+...+1/n C++ 通过 100 1 MS 240 KB 189 2024-07-12 11:25:56

Tests(5/5):


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


测评信息: