牛客网-《剑指offer》-跳台阶

题目:http://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4

C++

1 class Solution {
2 public:
3     int jumpFloor(int n) {
4         if (n == 1 || n == 2) return n;
5         return jumpFloor(n - 1) + jumpFloor(n - 2);
6     }
7 };
原文地址:https://www.cnblogs.com/CheeseZH/p/5112899.html