Climbing Stairs 带测试版
2016-04-27 16:42
344 查看
public class Solution70 { public static int climbStairs(int n) { int m=0; if(n<=0) return 0; if(n==1) return 1; if(n==2) return 2; int a=1,b=2,c=0; for(int i=2;i<n;i++) { c=a+b; a=b; b=c; } return c; } public static void main(String[]args) { int n=10; System.out.println(climbStairs(5)); } }
相关文章推荐
- win7系统开机提示cpu variable mtrr configure failed解决方法
- relation "public.***" contains more than "max_fsm_pages" pages with useful free space
- fail2ban 配置文件说明
- SSH登陆 Write failed: Broken pipe解决办法
- Vagrant: Warning: Authentication failure. Retrying
- Codeforces 582B Once Again... 【LIS变形】
- 【翻译】Xibo官方文档6-CMS Maintenance
- 朴素贝叶斯 垃圾邮件检测 Naive Bayes Spam detection
- CSAcademy Beta Round #4 Swap Pairing
- 山东省第五届ACM省赛题——Painting Cottages(求点集的划分)
- CGRectContainsPoint的具体用法解释
- 理解 %IOWAIT (%WIO)
- TIME_WAIT和CLOSE_WAIT状态区别
- You have new mail in /var/spool/mail/root
- leetcode 11. Container With Most Water
- fn contains 包含字符串 三种方法判断
- Troubleshooting 'library cache: mutex X' waits. (文档 ID 1357946.1)
- 习近平主席关心人工智能事业的发展
- WAITEVENT: "library cache: mutex X" (文档 ID 727400.1)
- RAID的介绍和RAID的安装