fork(3) download
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. const int size = 5;
  8. int a[size] = {1, 2, 3, 4, 5};
  9.  
  10.  
  11. std::reverse(&a[0], &a[0] + size);
  12.  
  13. for (int i = 0; i < size; ++i) {
  14. cout << a[i] << " ";
  15. }
  16.  
  17.  
  18. // your code goes here
  19. return 0;
  20. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
5 4 3 2 1