标签:++ 超级楼梯 include for str 输入 数字 ios namespace
Problem Description
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int n, i, j; 6 int a[40]; 7 a[2] = 1; 8 a[3] = 2; 9 for (i = 4; i <= 40; ++i) 10 a[i] = a[i - 1] + a[i - 2]; 11 cin >> n; 12 for (i = 0; i<n; ++i) 13 { 14 cin >> j; 15 cout << a[j] << endl; 16 } 17 }
标签:++ 超级楼梯 include for str 输入 数字 ios namespace
原文地址:http://www.cnblogs.com/zyb993963526/p/6021450.html