70.Climbing Stairs
生活随笔
收集整理的這篇文章主要介紹了
70.Climbing Stairs
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
class Solution {
public:int climbStairs(int n) {if (n == 1)return 1;int first = 1;int second = 2;for(int i = 3; i < n+1; i++){int third = first + second;first = second;second = third;}return second;}
};
轉載于:https://www.cnblogs.com/smallredness/p/10675639.html
總結
以上是生活随笔為你收集整理的70.Climbing Stairs的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 6-STM32物联网开发WIFI(ESP
- 下一篇: selenium自动加载Flash