daily pastebin goal
45%
SHARE
TWEET

MMMpastaaaaa

a guest Mar 24th, 2019 46 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;
  8.     modifiedv.push_back(1);
  9.     for (int i=0; i<v.size()-1; ++i)
  10.     {
  11.      modifiedv.push_back(v[i]+v[i+1]);
  12.     }
  13.     modifiedv.push_back(1);
  14.     return modifiedv;
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20.     vector<int> v;
  21.     v.push_back(1);
  22.     v.push_back(2);
  23.     v.push_back(1);
  24.     v=SupaDupaFirstTaskSolver(v);
  25. for (int i=0; i<v.size(); ++i)
  26. {
  27.     cout << v[i]<<" ";
  28.  
  29. }
  30. return 0;
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
 
Top