手指舞蹈 2018-11-05 16:01 采纳率: 0%
浏览 2202
已采纳

关于C语言计算泰勒展开式的问题,详细要求如下

图片说明

  • 写回答

1条回答 默认 最新

  • threenewbee 2018-11-05 16:37
    关注

    图片说明

     #include <stdio.h>
    
    int main(void) {
        while (true)
        {
            float x;
            scanf("%f", &x);
            float xs = 1;
            float ps = 1;
            float d = xs / ps;
            float r = d;
            int i = 1;
            while (d > 0.0001)
            {
                xs *= x;
                ps *= i++;
                d = xs / ps;
                r += d;
            }
            printf("%.2f\n", r);
        }
        return 0;
    }
    

    https://ideone.com/Y8H6Xx

    https://download.csdn.net/download/caozhy/10766667

    如果问题得到解决请点我回答左上角的采纳,谢谢

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?