标签:color ret turn 楼梯 cli air i++ for param
public class Solution { /** * @param n: An integer * @return: An integer */ int climbStairs(int n) { if(n==0) { return 1; } int []a=new int[n+1]; a[0]=1; a[1]=1; for(int i=2;i<=n;i++) { a[i]=a[i-2]+a[i-1]; } return a[n]; } };
标签:color ret turn 楼梯 cli air i++ for param
原文地址:http://www.cnblogs.com/ppcwmz/p/6512179.html