题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
class Solution { public: int jumpFloor(int number) { int a=0,b=1,c=2; for(int i=0;i<number;i++){ a=b; b=c; c=a+b; } return a; } };
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
class Solution { public: int jumpFloor(int number) { int a=0,b=1,c=2; for(int i=0;i<number;i++){ a=b; b=c; c=a+b; } return a; } };
相关推荐