Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int num, mas1[num], mas2[num];
  7. int buf1;
  8. cout << "Enter the mas number: ";
  9. cin >> num;
  10. cout << "Enter mas:";
  11. for (int i = 0; i < num; i++)
  12. {
  13. cin >> mas1[i];
  14. }
  15. // cout << "Initial mas:";
  16. // for (int i = 0; i < num; i++)
  17. // {
  18. // cout <<" "<< mas1[i];
  19. // }
  20.  
  21. for (int i = num - 1; i > 0; i--)
  22. {
  23. mas2[i] = mas1[num-1-i];
  24. }
  25.  
  26. for (int i = 0; i < num; i++)
  27. {
  28. cout <<" "<< mas2[i];
  29. }
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement