题目传送门:HDU 2014:超级楼梯
简单动态规划(斐波那契数列)
#include <iostream>
using namespace std;
int main()
{
int cases, n, g, f;
cin >> cases;
while (cases--) {
cin >> n;
g = 0; f = 1;
while (n--) {
f += g;
g = f - g;
}
cout << g << endl;
}
return 0;
}