Niu Ke (9) Abnormal jumping stairs

// Title description 
// A frog can jump up 1 steps at a time, or 2 steps at a time...it can also jump up n steps.
// Find how many ways the frog can jump on a n-level stair.
public static int JumpFloorII(int target) {
if (target==0||target==1){
return 1;
}
int count=0;
for (int i=1;i<=target;i++){
count += JumpFloorII(target-i);
}
return count;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325342860&siteId=291194637