fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int k;
  7. cin >> k;
  8. int t[k];
  9. for(int i=0; i < k; i++ )
  10. {
  11. cin >> t[i];
  12. }
  13. for(int i=0; i < k; i++)
  14. cout << t[k-i-1] << " ";
  15. return 0;
  16. }
Success #stdin #stdout 0s 3344KB
stdin
5
1 2 3 4 5 
stdout
5 4 3 2 1