举个例子,我们来计算阶乘 n! = 1 * 2 * 3 * ... * n
n! = 1 * 2 * 3 * ... * n
1! = 1 2! = 2 × 1 = 2 × 1! 3! = 3 × 2 × 1 = 3 × 2! 4! = 4 × 3 × 2 × 1 = 4 × 3! ... n! = n × (n-1)!
说白了,递归函数,就是自己调用自己!