十万火急 浙大OJ 1113 u Calculate e 显示Output Limit Exceeded 大侠帮我看看
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/06/16 16:31:27
十万火急 浙大OJ 1113 u Calculate e 显示Output Limit Exceeded 大侠帮我看看 这是怎么了?
Background
A simple mathematical formula for e is
where n is allowed to go to infinity.This can actually yield very accurate approximations of e using relatively small values of n.
Output
Output the approximations of e generated by the above formula for the values of n from 0 to 9.The beginning of your output should appear similar to that shown below.
Example
Output
n e
- -----------
0 1
1 2
2 2.5
3 2.666666667
4 2.708333333
这是我的代码.
#include
int main()
{
int n,b;
double e,a=1.00;
for(n=0;n=2)
{
a=a/n;
e=e+a;
}
printf("%lf\n",e);
}
return 0;
}
Background
A simple mathematical formula for e is
where n is allowed to go to infinity.This can actually yield very accurate approximations of e using relatively small values of n.
Output
Output the approximations of e generated by the above formula for the values of n from 0 to 9.The beginning of your output should appear similar to that shown below.
Example
Output
n e
- -----------
0 1
1 2
2 2.5
3 2.666666667
4 2.708333333
这是我的代码.
#include
int main()
{
int n,b;
double e,a=1.00;
for(n=0;n=2)
{
a=a/n;
e=e+a;
}
printf("%lf\n",e);
}
return 0;
}
![十万火急 浙大OJ 1113 u Calculate e 显示Output Limit Exceeded 大侠帮我看看](/uploads/image/z/5124679-7-9.jpg?t=%E5%8D%81%E4%B8%87%E7%81%AB%E6%80%A5+%E6%B5%99%E5%A4%A7OJ+1113+u+Calculate+e+%E6%98%BE%E7%A4%BAOutput+Limit+Exceeded+%E5%A4%A7%E4%BE%A0%E5%B8%AE%E6%88%91%E7%9C%8B%E7%9C%8B)
#include
#include
using namespace std;
int F(int n)
{
int i,m=1;
for(i=1;i
#include
using namespace std;
int F(int n)
{
int i,m=1;
for(i=1;i
十万火急 浙大OJ 1113 u Calculate e 显示Output Limit Exceeded 大侠帮我看看
Output Limit Exceeded这是什么意思?
杭电里面的Output Limit Exceeded
杭电ACM2006提示Output Limit Exceeded,
Time Limit Exceeded和Output Limit Exceeded有什么不同,还是一样的?
浙大OJ 2987Misspelling WA 坐等大侠指点
Bandwidth Limit Exceeded
大侠帮我看看问题吧fatal error C1903:unable to recover from previous e
Output Limit Exceed怎么回事
C语言聪明的GG 为什么代码显示Output Limit Exceed
各位大侠帮我看看我的matlab程序,
求各位大侠帮我看看我有没做对