#include <stdio.h> #include <math.h> int main(){ double x; double sum = 1.0; double term = 1.0; int k = 1; if (scanf("%lf", &x) != EOF && x >= 0 && x <= 5) { while (fabs(term) > 0.00001) { term *= x / k; sum += term; k++; } printf("%.4f", sum); } else { printf("input x wrong"); } return 0; }
c语言编程练习题:7-58 求幂级数展开的部分和
作者:yunjinqi
类别:编程
日期:2023-05-29 17:28:09
阅读:573 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/183
最新文章
系统当前共有 404 篇文章