Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152047 邓弘锐 13分数求和 C++ Accepted 1 MS 272 KB 244 2026-04-19 15:04:03

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ double sum=0; double fz,fm,t; fz=2,fm=1; int n; cin>>n; for(int i=1;i<=n;i++){ sum=sum+(fz/fm); t=fm; fm=fz; fz=t+fz; } printf("%.4lf",sum); return 0; }