答案

gonghongbo2021 2023-01-12 15:46:35 1 返回题目

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

{{ vote && vote.total.up }}