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?
Note: Given n will be a positive integer.
你正在爬樓梯。到頂端總共有n階。
每次你都可以爬1或是2階,請問你總共有幾種不同的方法爬到頂呢?
提醒:n只會是正整數。
n
階會是n-1
和n-2
的加總,答案即為費氏數列。LeetCode
C++