Topic description
Everyone knows the Fibonacci sequence, and now you are asked to input an integer n, please output the nth item of the Fibonacci sequence.
n<=39
class Solution { public: int Fibonacci(int n) { vector<int>vt; vt.push_back(0); vt.push_back(1); int i; for(i = 2; i <= n; i++) { vt.push_back(vt[i-1] + vt[i-2]); } return vt[n]; } };