study/java/src/com/thinker/bishi/saima/Test.java

25 lines
497 B
Java

package com.thinker.bishi.saima;
/**
* @author lzh
*/
public class Test {
private static int count = 0;
private static void jump(int num,int jump){
if((num - jump) > 0) count += jump;
else return;
num -= jump;
jump(num, 1);
jump(num, 2);
}
private static int jump(int num){
jump(num ,1);
jump(num , 2);
return count;
}
public static void main(String[] args) {
System.out.println(jump(3));
}
}