Problem1297--使用函数求1到10的阶乘和

1297: 使用函数求1到10的阶乘和

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

本题要求实现一个计算非负整数阶乘的简单函数,使得可以利用该函数,计算1!+2!+⋯+10!的值。 函数接口定义: double fact( int n ); 其中n是用户传入的参数,其值不超过10。如果n是非负整数,则该函数必须返回n的阶乘。 裁判测试程序样例: #include double fact( int n ); int main(void) { int i; double sum; sum = 0; for(i = 1; i <= 10; i++) sum = sum + fact(i); printf(

Input

本题没有输入

Output

本题没有输入

Sample Input Copy

本题没有输入

Sample Output Copy

1!+2!+...+10! = 4037913.000000

Source/Category