标签:
Description
Input
Output
Sample Input
Sample Output
1 #include<iostream> 2 #include<cmath> 3 #include<algorithm> 4 using namespace std; 5 6 7 int main() 8 { 9 int n; 10 cin>>n; 11 while(n--) 12 { 13 int t; 14 cin>>t; 15 int a[50]; 16 a[1] = 1; 17 a[2] = 2; 18 for(int i = 3;i<t;i++) 19 a[i] = a[i-1]+a[i-2]; 20 cout<<a[t-1]<<endl; 21 } 22 23 }
标签:
原文地址:http://www.cnblogs.com/qlky/p/4958421.html