/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:吴雨凡
*版本:v6.0
*
*问题描述:用递归方法求解
*输入描述:
*程序输出:判断相关问题
*/
#include <iostream>
using namespace std;
long f(int n);
int main()
{
int a,b;
cout << "请输入一个数:" << endl;
cin>>a;
if(a%2)
b=f(a);
else
b=f(a-1);
cout<<b<<endl;
return 0;
}
long f(int n)
{
long c;
if(n==1)
c=1;
else
c=n*f(n-2);
return c;
}