SHARE
TWEET

Untitled

a guest Mar 24th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. vector<int> SupaDupaFirstTaskSolver(vector<int> v)
  6. {
  7.     vector<int> modifiedv(1,1);
  8.     for (int i=0; i<v.size()-1; ++i)
  9.     {
  10.      modifiedv.push_back(v[i]+v[i+1]);
  11.     }
  12.     modifiedv.push_back(1);
  13.     return modifiedv;
  14. }
  15. int main()
  16. {
  17.     vector<int> v(1,1);
  18.     v=SupaDupaFirstTaskSolver(v);
  19. for (int i=0; i<v.size(); ++i)
  20. {
  21.     cout << v[i]<<" ";
  22. }
  23. return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top