
题目描述
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 |
public class { |

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 |
public class { |
近期评论