Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- void displayVector(vector <int> v){
- for(unsigned int i=0; i<v.size(); i++){
- cout << v[i] << endl;;
- }
- }
- int main()
- {
- vector <int> fibo = vector <int> ();
- fibo.push_back(1);
- fibo.push_back(1);
- int size1 = 46;
- for(int i=2; i<size1; i++){
- fibo.push_back(fibo[i-1] + fibo[i-2]);
- }
- displayVector(fibo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement