本题要求实现一个计算非负整数阶乘的简单函数。
int Factorial( const int N )
{
if ( N<0 ) return 0;
if ( N==0 ) return 1;
return N * Factorial( N-1 );
}
本题要求实现一个计算非负整数阶乘的简单函数。
int Factorial( const int N )
{
if ( N<0 ) return 0;
if ( N==0 ) return 1;
return N * Factorial( N-1 );
}