Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7667 | zhaoziwen | 求出e的值 | C++ | 解答错误 | 0 MS | 240 KB | 245 | 2023-02-06 13:37:43 |
#include<iostream> #include<iomanip> using namespace std; int main () { int n; cin>>n; int e=1; for(int i=1;i<=n;i++){ int a=1; a=1.0*a/i; e=e+a; } cout<<fixed<<setprecision(10)<<e; }