| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 130735 | 王奕杰 | 求序列的前n项和 | C++ | Accepted | 2 MS | 272 KB | 477 | 2025-09-15 19:15:00 |
#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(){ double m=1,z=2,f=z/m,n,m0=1,z0=2; cin>>n; for(int i=2;i<=n;i++){ z=m0+z0; m=z0; f+=z/m; m0=m; z0=z; } cout<<f; return 0; }