/*
*Copyright (c) 2014 ,烟台大学计算机学院
*All right reserved.
*文件名称:n的阶乘.cpp
*作 者:王伟诚
*完成日期:2014年11月18日
*版 本 号:1.0
*
*问题描述:求n的阶乘
*问题输入:一个整数
*问题输出:n的阶乘
*/
#include <iostream>
using namespace std;
int f(int n);
int main()
{ int n;
cin>>n;
cout<<f(n)<<endl;
return 0;
}
int f(int n)
{
int c;
if(n==1)
c=1;
else
{c=f(n-1)*n;
return c;}
}