Advertisement
anon20016

2

Dec 12th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <vector>
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. int n = 14;
  11. double a[14];
  12. for (int i = 0; i < n; i++) {
  13. cin >> a[i];
  14. }
  15. int count = 0;
  16. for (int i = 0; i < n / 2; i++) {
  17. double t = a[i];
  18. a[i] = a[i + n / 2];
  19. a[i + n / 2] = t;
  20.  
  21. count++;
  22. }
  23. for (int i = 0; i < n; i++) {
  24. cout << a[i] << ' ';
  25. }
  26. cout << endl << count;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement