| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 12354 | 陈颖钧 | 求1/1+1/2+2/3+3/5+5/8+8/13+13/21……的前n项的和 | C++ | Accepted | 100 | 1 MS | 268 KB | 239 | 2025-07-10 16:28:16 |
#include<bits/stdc++.h> using namespace std; double n; double fun(int n){ double sum=0; for(double i=1;i<=n;i++){ sum+=1/i; } return sum; } int main(){ cin>>n; cout<<setprecision(3)<<fixed<<fun(n); }