# LeetCode - 0070. Climbing Stairs ### 題目網址:https://leetcode.com/problems/climbing-stairs/ ###### tags: `LeetCode` `Easy` `模擬` ```cpp= /* -LeetCode format- Problem: 70. Climbing Stairs Difficulty: Easy by Inversionpeter */ class Solution { public: int climbStairs(int n) { unsigned first = 1, second = 2, temporary; while (--n) temporary = first + second, first = second, second = temporary; return first; } }; ```