提交时间:2025-10-18 18:07:29

运行 ID: 70595

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