#include <stdio.h>
int fatorialWithNum(int num); int main(int argc, const char * argv[]) { @autoreleasepool { int result = fatorialWithNum(6); printf("%d\n",result); } return 0; } int fatorialWithNum(int num) { if (num - 1 > 1) { return num * fatorialWithNum(num - 1); } else { return num; } }
原文:http://www.cnblogs.com/yaann/p/4201412.html