• 2629 求阶乘

    Time Limit : 2000/1000 MS(Java/Others) | Memory Limit : 65536/32768 KB(Java/Others)

    Submits : 13656 | Solved : 8601

    Description

    编写函数,对于给定的整数n,求n!的值并返回。

    Input

    给定一个正整数nn12)。


    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

    [ Top ] | [ Submit ] | [ Statistics ] | [ Standing ]