题目:一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶,求该青蛙跳上一个n级台阶总共有多少中跳法. http://www.nowcoder.com/books/coding-interviews?page=1 思路:问题本质上是fibonacci问题. class Solution {public: int jumpFloor(int number) { int jumpNumber=0;//青蛙跳台阶跳法 if(0>=number){jumpNumber=0;} else if(1==numb…
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water. Given a list of stones' positions (in units) in sorted ascending ord…