通过该描述我们对其实现
int Fibonacci(int n) { int a = 0, b = 1; while (n--) { b = a + b; a = b - a; } return a; } int Fibonacci(int n) { if (n <= 0) return 0; if (n==1||n==2) return 1; return Fibonacci(n - 1) + Fibonacci(n - 2); } int Fibonacci(int n) { int a[100] = { 0 }; a[1] = 1; a[2] = 1; for (int i = 3; i <= n; i++) a[i] = a[i - 1] + a[i - 2]; return a[n]; }