- 解法一:斐波那契数列
- 解法二:纯循环,因为第3天的猪要被sha掉,所以a+b就可以
#include<bits/stdc++.h>
using namespace std;
int t, n, m;
int main(){
ios::sync_with_stdio(false);
cin >> t;
while(t --){
cin >> n;
int a = 1, b = 0, c = 0, tem;
for(int i = 2; i <= n; i ++){
c = b;
b = a;
a = b+c;
}
cout << a+b << endl;
}
return 0;
}