Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
78369 sh25_linzx 求分数序列和 C++ 通过 0 MS 244 KB 245 2025-12-26 15:42:06

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; }


测评信息: