JZ10、矩形覆盖
矩形覆盖
http://www.nowcoder.com/questionTerminal/72a5a919508a4251859fb2cfb987a0e6
递推公式: f(n) = f(n -1) + f(n-2)
public class Solution {
public int RectCover(int target) {
if(target <= 1)
return target;
int a = 1,b = 2, temp = 2;
for(int i = 2; i < target; i++){
temp = b;
b += a;
a = temp;
}
return b;
}
} 
