题解 | #跳台阶#青蛙跳台阶,迭代法
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
class Solution { public: int diedai(int n) { if(n==1) return 1; if(n==2) return 2; return diedai(n-1)+diedai(n-2); } int jumpFloor(int number) { return diedai(number); } };