#include<stdio.h>
long long factorial(int n);//函数声明
int main()
{
long long sum = 0;//奇数阶乘求和结果
int max_odd = 15;//最大奇数值
for( int n = 1; n <= max_odd; n += 2){ //定义n=1,3,5...max
sum += factorial(n);//n的阶乘累加求和
}
printf("1!+3!+5!+...+%d!=%lld\n",max_odd,sum);//显示结果
return 0;
}
long long factorial(int n)
{
if( n == 0 ) return 1;
return n * factorial( n - 1 );//递归求阶乘
}