import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param number int整型 * @return int整型 */ public int jumpFloor (int number) { int[] a = new int[number+1]; int c = 0; if(number <= 0){ return 0; } if(number == 1){ return 1; } if(number == 2){ return 2; } for(int i=1;i<=number;i++){ c = jumpFloor2(i,a); a[i] = c; } return a[number]; } public int jumpFloor2(int number,int[] a){ if(a[number] !=0){ return a[number]; } int c = 1; int b = 2; int d = 0; for(int i=2;i<=number;i++){ d =c+b; c= b; b = d; } return c; } }