牛客(9)变态跳台阶

//    题目描述
// 一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。
// 求该青蛙跳上一个n级的台阶总共有多少种跳法。
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;
}

猜你喜欢

转载自www.cnblogs.com/kaibing/p/8989434.html