4-7

#include<stdio.h>
int main(void)
{
    int i,j;
    double item,sum;

    sum=0;
    for(i=1;i<=100;i++){
        item=1;
        for(j=1;j<=i;j++)
            item=item*j;
        sum=sum+item;
    }
    printf("1!+2!+...+100!=%e\n",sum);

    return 0;
}

posted on 2013-10-07 22:42  yy99  阅读(88)  评论(0编辑  收藏  举报