- 【例28.2】 求出e的值
求解
- 2025-1-1 12:39:48 @
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,t=1;
double a=1;
cin>>n;
for(int i=1;i<=n;i++){
t*=i;
a+=1.0/t;
}
cout<<fixed<<setprecision(10)<<a<< endl;
return 0;
}
麻烦大佬看下为什么只有八十分
1 条评论
-
[吴雨霖]chan 可爱! LV 9 (50/50) @ 2025-1-4 22:32:43
t改成double类型
- 1
信息
- ID
- 78
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 11
- 已通过
- 7
- 上传者