首页 > 代码库 > 爬楼梯

爬楼梯

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);

    }

}

爬楼梯