2629 求阶乘
Time Limit : 2000/1000 MS(Java/Others) | Memory Limit : 65536/32768 KB(Java/Others)
Submits : 13689 | Solved : 8625
Description
编写函数,对于给定的整数n,求n!的值并返回。Input
给定一个正整数n(n≤12)。
Output
计算并返回n!的值。
Sample Input
5
Sample Output
120
Template
#include<stdio.h>
@-@
int main()
{
int n,result;
scanf("%d",&n);
result=fact(n);
printf("%d\n",result);
return 0;
}HINT
程序填空题,模板中@-@的位置是需要填空的部分。
Source
NBU OJ
浙公网安备 33020402000166号