#include <stdio.h> #include <math.h>

int main() { double x, s = 0;

printf('请输入x的值:');
scanf('%lf', &x);

for (int n = 0; n <= 10; n++) {
    double term = pow(x, n) / (double)(n + 1); // 计算每一项的值
    s += term; // 累加每一项
}

printf('s的值为:%lf\n', s);

return 0;

}


原文地址: https://www.cveoy.top/t/topic/Ry7 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录