Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
83851 sh25_zhoumy 求出e的值 C++ Accepted 0 MS 252 KB 283 2026-02-03 11:28:35

Tests(1/1):


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


Judgement Protocol: