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 @ 2013-10-04 18:23  zhaoyang16  阅读(87)  评论(0编辑  收藏  举报