Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <vector>
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int n = 14;
- double a[14];
- for (int i = 0; i < n; i++) {
- cin >> a[i];
- }
- int count = 0;
- for (int i = 0; i < n / 2; i++) {
- double t = a[i];
- a[i] = a[i + n / 2];
- a[i + n / 2] = t;
- count++;
- }
- for (int i = 0; i < n; i++) {
- cout << a[i] << ' ';
- }
- cout << endl << count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement