#include <iostream>
using namespace std;
int main()
{
int f[41] = {0, 1, 2};
int i, n, m;
for( i = 3; i < 40; i++)
{
f[i] = f[i-1] + f[i-2];
}
cin >> n;
while ( n-- )
{
cin >> m;
cout << f[m-1]<<endl;
}
return 0;
}
数学的思想
递推