24.蓝桥杯2013第四题-第39级台阶

2018-03-31  本文已影响0人  FiveZM

/* https://www.cnblogs.com/zhezh/p/3773477.html

public class B4 {
    static int count = 0;
    public static void main(String[] args) {
        
        f(0,0);
        System.out.println(count);
    }
    private static void f(int startFloor, int stepNumber) {
        if(startFloor>39)
        {
            return;
        }
        if(startFloor==39)
        {
            if(stepNumber%2==0)
                count++;
        }
        f(startFloor+1,stepNumber+1);
        f(startFloor+2,stepNumber+1);
    }

}

上一篇下一篇

猜你喜欢

热点阅读