求斐波那契数列第n项
unsigned int fibonacci(unsigned int n) { if (n == 0 || n == 1) { return n; } else { return fibonacci(n-1) + fibonacci(n-2); } }
递归
unsigned int fibonacci(unsigned int n) { if (n == 0 || n == 1) { return n; } else { return fibonacci(n-1) + fibonacci(n-2); } }
递归