#include <iostream> #include <vector> using namespace std; int main() { vector<int> v{1,1}; for(int i=0; i!=5; ++i) v.push_back(*v.rbegin() + *(v.rbegin()+1)); for(auto p: v) cout << p << ' '; }
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment