Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119740 | 王晏林 | 13分数求和 | C++ | Accepted | 1 MS | 272 KB | 263 | 2025-05-18 17:43:07 |
#include<iostream> #include<cstdio> using namespace std; int main(){ int n; double a=2,b=1,s=0,t; cin>>n; for(int i=1;i<=n;i++){ s=s+a/b; t=a; a=a+b; b=t; } printf("%.4lf",s); return 0; }