剑指offer 矩形覆盖

class Solution {
public:
    int rectCover(int number) {
        if(number == 0)
            return 1;
		int a[10005];
        a[1] = 1;
        a[2] = 2;
        for(int i = 3; i < 10005; i++)
            a[i] = a[i - 1] + a[i - 2];
        return a[number];
    }
};

你可能感兴趣的:(C++,算法,指针,递推,剑指offer)