class Solution {
public: //1级台阶:1种 2级台阶:2种 3级台阶:4种 4级台阶:8种
//即满足:跳法=2的number-1次方
int jumpFloorII(int number) {
if(number<=1)
{
return number;
}
int sum=1;
while(number-1)
{
sum*=2;
number--;
}
return sum;
}
};