class Solution { public: int jumpFloor(int number) { if(number == 0){ return 1; } if(number == 1){ return 1; } int a = 1; int b = 1; int c = 0; while((number--) > 1){ c = a + b; a = b; b = c; } return c; } };
原文:http://www.cnblogs.com/dingxiaoqiang/p/7905739.html