爬楼梯

public class Solution {

    /**

     * @param n: An integer

     * @return: An integer

     */

    public int climbStairs(int n) {

        // write your code here

         if(n==1)

         return 1;

         else if(n==2)

         return 2;

         else return fun(n-1)+fun(n-2);

    }

}

posted on 2017-03-14 18:08  TYYD  阅读(133)  评论(0编辑  收藏  举报

导航