#include <stdio.h>
#include "math.h"
int main() {
int i=1;
double x=0,y=0,s=0;
do {
x=y;
s=1+(1.0/i);
y= pow(s,i);
i++;
} while (fabs(y-x)>1e-6);
printf("the e zhi is : %lf\n,the n zhi is : %d",y,i);
return 0;
}
估算e的大小 14-2 程序设计
最新推荐文章于 2025-12-09 19:50:25 发布
本文介绍了一个用C语言编写的程序,通过循环和迭代计算求解一个精确值,直到两个连续结果之间的差小于1e-6。
12万+

被折叠的 条评论
为什么被折叠?



