fork(1) download
  1. #include <vector>
  2. #include <iostream>
  3. #include <algorithm>
  4. int main()
  5. {
  6. const int n = 3;
  7. //cin >> n;
  8. int arr[n] ;
  9. for(int i = 0; i<n; i++){
  10. std::cin >> arr[i] ;
  11. }
  12. std::reverse(std::begin(arr), std::end(arr));
  13. for(int j=0;j<n;j++){
  14. std::cout<< arr[j] <<" ";
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 4156KB
stdin
1 2 3
stdout
3 2 1