Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
77606 sh25_zhangjiajia 求分数序列和 C++ 通过 0 MS 248 KB 254 2025-12-26 14:32:20

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int main() { int n,q=2,p=1; float sum=2; cin >>n; for(int i=2;i<=n;i++) { int temp; temp=p; p=q; q=q+temp; sum+=q*1.0/p; } cout << fixed<<setprecision(4)<<sum; return 0; }


测评信息: