剑指offer(10)矩形覆盖
public class Solution {
public int RectCover(int target) {
int a = 1,b = 2,c = 0;
if(target < 0){
return -1;
}else if(target == 0){
return 0;
}else if(target == 1){
return 1;
}else if(target == 2){
return 2;
}else{
for(int i =3;i <= target;i++){
c = a+b;
a = b;
b = c;
}
return c;
}
}
}