多项式之和

一、问题描述:

 

 

二、设计思路:

 

 

三、程序流程图:

 

 

 

 

四、代码实现:

#include<stdio.h>
int main()
{
    double S=0;
    int i,j,x;
    double temp=1;
    printf("请输入一个数字求到这个数字的多项式之和\n");
    scanf("%d",&x);
    for(i=0;i<x;i++)
    {
        temp=1;
        for(j=1;j<=i+1;j++)
        {
            temp*=j;
        }
    
        S+=1/temp;
    }
    printf("%f",S);
    
    
    
    
    return 0;
}

 

posted @ 2023-05-24 23:07  软件拓荒人  阅读(29)  评论(0)    收藏  举报