:
运行过了
输出e=2.718282
不知是否满意
望采纳
#include
void
main(){
long
fun(int
n)
int
i
double
e=0
double
eps=1e-6//eps表示精度
此处指10的-6次方
for(i=01.0/fun(i)>epsi++)
{
e+=1.0/fun(i)
}
printf("e=%lf\n",e)
}
long
fun(int
n)//求n!的函数
{
if(n==0)
return
1
else
return
n*fun(n-1)
}
以下程序没有经过调试(我在网吧,没带编译器),但多少可提供思路#include "math.h"
void main()
{
double e
unsigned int n=65535//用65535表示数学意义上的‘无穷大’
e=1+1/n
e=pow(e,n)//pow(double x,double n)表示求X的N次方
printf("%f",pow(e,2.567))
getch()
}
3e4表示3倍e的4次方,e是一个自然常数,为数学中一个常数,是一个无限不循环小数,且为超越数,其值约为2.718281828459045,所以一般不会写具体数字,用e来表示,而式子中如果包含e就说明这是一个常量。实型数据的指数表示形式,e前面为十进制数,e后面为十进制整数,可以带符号。
以上仅供参考