fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. vector<int>arr={1,3,4,5};
  8. for(auto it=arr.rbegin();it!=arr.rend();it++){
  9. cout<<*it<<endl;
  10. }
  11. for(auto it=arr.begin();it!=arr.end();it++){
  12. cout<<*it<<endl;
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
5
4
3
1
1
3
4
5