| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 133115 | 左锶焜 | 13分数求和 | C++ | Accepted | 1 MS | 272 KB | 477 | 2025-10-14 19:47:06 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n; double z=2,m=1,z0=2,m0=1,s=2; cin>>n; for(int i=2;i<=n;i++){ z=m0+z0; m=z0; s+=z/m; z0=z; m0=m; } printf("%.4lf",s); return 0; }