G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 8th, 2020 188 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <map>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. vector<int> Reversed(const vector<int>& v) {
  10.     vector<int> s;
  11.     for (int i = v.size() - 1; i >= 0; --i) {
  12.         s.push_back(v[i]);
  13.     }
  14.     return s;
  15. }
  16.  
  17. int main() {
  18.     vector<int> numbers = { 1, 5, 3, 4, 2 };
  19.     Reversed(numbers);
  20.     // numbers должен оказаться равен {2, 4, 3, 5, 1}
  21.     cout << "numbers - ";
  22.     for (auto w : numbers) {
  23.         cout << w << " ";
  24.     }
  25.     return 0;
  26. }
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