标签:generate stat generated auto style eth div class 青蛙跳
package suanfati; /* * 青蛙跳台阶算法 * 每次可以跳1级或两级,请问有n级台阶,有多少种算法 * 递归算法 */ public class FrogJump { public static int JumpFloor(int n) { if(n<0) return 0; int []fibArry = {0,1,2}; if(n<3) return fibArry[n]; return JumpFloor(n-1)+JumpFloor(n-2); } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(JumpFloor(5));//8 } }
标签:generate stat generated auto style eth div class 青蛙跳
原文地址:http://www.cnblogs.com/liuzhenping/p/7580903.html