牛客题霸--跳台阶题解
跳台阶
http://www.nowcoder.com/questionTerminal/8c82a5b80378478f9484d87d1c5f12a4
算出前几项就可以找到此规律
class Solution { public: int jumpFloor(int number) { int a[10010]; a[0] = 0, a[1] = 1, a[2] = 2; for ( int i = 3; i < 10010; i++ ) a[i] = a[i-1] + a[i-2]; return a[number]; } };