提交时间:2025-10-22 19:12:45
运行 ID: 70916
#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; }