首页 > 代码库 > Climbing Stairs

Climbing Stairs

题目:

You are climbing a stair case. It takes n steps to reach to the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

我的解法:

(1)算法思想:

问题可以转化成fibonacci问题

(2)代码如下:

<script src="https://code.csdn.net/snippets/589495.js" type="text/javascript"></script>

Climbing Stairs