fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. vector<int> v;
  8. v.push_back(1);
  9. v.push_back(2);
  10. v.push_back(3);
  11. reverse(v.begin(),v.end());
  12. for(auto& e : v)
  13. cout << e << " ";
  14. return 0;
  15. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
3 2 1