//思考當n>2 要跳n階和n-1,n-2有關code
public class Solution {get
public int JumpFloor(int target) { if(target==1 ||target==2) return target; int f1=1,f2=2,fn=0,i=3; while(i<=target){ fn=f1+f2; f1=f2; f2=fn; i++; } return fn; }
}io