Advertisement
RynkunPokemon

return a new array with each value doubled

Nov 23rd, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <vector>
  2.  
  3. std::vector<int> maps(const std::vector<int> & values) {
  4.   std::vector<int> a = values;
  5.   for(std::vector<int>::iterator it = a.begin(); it != a.end(); it++){
  6.   *it=2**it;
  7.   }
  8.   return a;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement