Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
78369 sh25_linzx 求分数序列和 C++ Accepted 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; }


Judgement Protocol: