提交时间:2020-08-23 19:59:28

运行 ID: 6132

#include <bits/stdc++.h> using namespace std; int main() { int t, n; long long a[25]; cin >> t; a[1] = 1; a[2] =2; while (t--) { cin >> n; for (int i = 3; i <= n; i++) a[i] = a[i - 1] + a[i - 2]; cout << a[n] << endl; } }