Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
7365 suxing 求出e的值 C++ 通过 0 MS 252 KB 247 2023-02-03 18:48:51

Tests(1/1):


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


测评信息: