fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int tab[30]={};
  7.  
  8. int n;
  9. cin >> n;
  10.  
  11. if (n>=1 && n<=30)
  12. {
  13. for(int i=0; i<n; i++)
  14. cin >> tab[i];
  15.  
  16. for(int i=n-1; i>=0; i--)
  17. cout << tab[i] << " ";
  18. } else cout << "Brak pamieci." << endl;
  19.  
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5312KB
stdin
150
1 2 3 4 5 100 76 24 54 12 98 53 46 19 2 
stdout
Brak pamieci.