- - 这其实是斐波拉契数列
class Solution {
int fib[100];
public:
int climbStairs(int n) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
fib[0] = fib[1] = 1;
for(int i = 2; i <= n; ++ i)
fib[i] = fib[i - 1] + fib[i - 2];
return fib[n];
}
};