提交时间:2026-01-25 21:30:19

运行 ID: 83420

#include<bits/stdc++.h> using namespace std; int jc(int n){ int s=1; for(int i=1;i<=n;++i){ s*=i; } return s; } int main() { double e=1; int f; cin>>f; for(int k=1;k<=f;++k){ e+=1.0/jc(k); } cout<<fixed<<setprecision(10)<<e; return 0; }