矩形覆盖

题目

分析

矩形覆盖

代码

public class Solution {
    public int RectCover(int target) {
        if(target<=2){
            return target;
        }
        int first=1;
        int second=2;
        int index=3;
        while (index<=target){
            int temp=first+second;
            first=second;
            second=temp;
            index++;
        }
        return second;
    }
}

posted @ 2018-04-02 16:07  baixiaoshuai  阅读(100)  评论(0编辑  收藏  举报