haha1235  
#include<stdio.h>
int main(void)
{
    int n;
    int factorial(int n);
    scanf_s("%d",&n);
    printf("%d\n",factorial(n));
    return 0;
}
int factorial(int n)
{
    int i,fact=1;
    for(i=1;i<=n;i++)
        fact=fact*i;
    return fact;
}

posted on 2013-10-07 10:36  haha1235  阅读(123)  评论(0编辑  收藏  举报