题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
#include <locale> class Solution { public: int jumpFloor(int number) { if(number==1) return 1; if(number==2)return 2; int a=1; int b=2; int temp=0; for(size_t i=3;i<=number;++i){ temp=(a+b)%1000000007; a = b; b = temp; } return temp; } };