计算阶层

2015-04-29 02:40:04 -0400
#include<stdio.h>
void main()
{
float sum=0;
float product=1;
int i;
for(i=1;i<=20;i++)
{
product*=i;
sum+=product;
}
printf("1!+2!+3!+4!+.....+20!=%e\n",sum);
}
«Newer      Older»
Comment:
Name:

Back to home

Subscribe | Register | Login | N