2 条题解

  • 0
    @ 2025-7-17 17:38:57

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

    • 0
      @ 2025-7-1 14:48:16

      #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; double s=1,z=1; for(int i = 1;i<=n;i++){ s=s*i; z+=1.0/s; } printf("%.10lf",z); return 0; }

      • 1

      信息

      ID
      390
      时间
      1000ms
      内存
      128MiB
      难度
      9
      标签
      递交数
      7
      已通过
      5
      上传者