蓝桥杯算法训练VIP-瓷砖铺放 (C++代码)
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int res(int num){
if(num == 1){
return 1;
}
if(num == 2){
return 2;
}
return res(num-1)+res(num-2);
}
int main()
{
int n;
scanf("%d", &n);
printf("%d",res(n));
return 0;
}