提交时间:2023-02-06 08:08:00

运行 ID: 7656

#include<iostream> #inlucde<iomanip> using namespace std; int main() { int n; cin >> n; int e=0; int k=1; int product=1; for (int i=1; i<=n; i++) { for (int j=1; j<=k; j++) { product*=j; j++; } e+=1/product; k++; } cout << fixed << setprecision(10) << e; }