class Solution { public: int jumpFloorII(int number) { if (number == 1) { return 1; } else if (number == 2) { return 2; } else { return(2 * jumpFloorII(number - 1)); } } };
时间: 2024-10-14 06:59:29
class Solution { public: int jumpFloorII(int number) { if (number == 1) { return 1; } else if (number == 2) { return 2; } else { return(2 * jumpFloorII(number - 1)); } } };