Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
354383 | 胡珂 | 【C2-2】 编程求1+1/2+1/3+...+1/n | C++ | Accepted | 100 | 2 MS | 252 KB | 191 | 2025-10-02 13:26:52 |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; double sum=0; for(int i=1;i<=n;i++){ sum+=1.0/i; } cout<<fixed<<setprecision(3)<<sum; return 0; }