用C语言编程,求e=1+1/1!+1/2!+1/3!+...+1/n!直到最后一项小于10-5,求...

发布网友 发布时间:2024-10-13 20:05

我来回答

2个回答

热心网友 时间:9分钟前

void main()
{ long i,m=1,n,counter=0;
float total=1;
for(i=1;(1.0/m)>10e-5;i++)
{
m=m*i;
total+=1.0/m;
counter++;}
printf("e is %f\n",total);
printf("count : %ld\n",counter);
getch();
}

热心网友 时间:4分钟前

int x = 0;
int n = 10;
float e = 1;
long temp;
for(;x<n;x++){
}

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com