提交时间:2024-12-11 17:20:45
运行 ID: 58497
#include<iostream> using namespace std; int main() { int n; double s1=1,s2; cin>>n; for(int i1=1;i1<=n;i1++) { s2=1; for(int i2=1;i2<=i1;i2++) s2/=(double)i2; s1+=s2; } cout<<fixed<<setprecision(10)<<s1; return 0; }