Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
70916 sh25_wangsj 求分数序列和 C++ 通过 0 MS 244 KB 254 2025-10-22 19:12:45

Tests(1/1):


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


测评信息: