编程序按下列公式计算e的值:e=1+1/1!+1/2!+3/3!+…+1/ni(精度为10-6)
main() { float e,i,t; e=t=i=1: while(1/t>=le-6)/*精度控制*/ {t=t*i++;/*计算阶乘;*/ e+=1/t; } printf("%f\n",e); }
扫描二维码免费使用微信小程序搜题/刷题/查看解析。
版权声明:本文由翰林刷题小程序授权发布,如需转载请注明出处。
本文链接:https://doc.20230611.cn/post/442206.html
上一篇:The sentence “three or four families in a country village are the very thing to work on” can best reflect the writer’s personal knowledge and range of writing. This writer is().
下一篇:按一定的程序设立,具有明确的组织目标、机构与职位体系和规章制度的组织类型是