数据结构-阶乘

 1 ///////////////////////////////////////////////////////////////////////////////
 2 //
 3 //  FileName    :   factorial.c?
 4 //  Version     :   0.10
 5 //  Author      :   Ryan Han
 6 //  Date        :   2013/07/01 10:12:30
 7 //  Comment     :  
 8 //
 9 ///////////////////////////////////////////////////////////////////////////////
10 #include <stdio.h>
11 
12 static long factorial(const long n)
13 {
14     return 0 == n || 1 == n ? 1 : n*factorial(n-1);
15 }
16 
17 int main()
18 {
19     long lResult = factorial(5);
20     printf("The resutl is: %ld
", lResult);
21 }
原文地址:https://www.cnblogs.com/dracohan/p/3164385.html