Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- const int MAX_SIZE = 99;
- string arr[MAX_SIZE]{};
- int arrSize;
- cin >> arrSize;
- for (int i = 0; i < arrSize; i++) {
- cin >> arr[i];
- }
- string x;
- for (int i = 0; i < arrSize / 2; i++) {
- x = arr[i];
- arr[i] = arr[arrSize - (i + 1)];
- arr[arrSize - (i + 1)] = x;
- }
- for (int i = 0; i < arrSize; i++) {
- cout << arr[i] << ' ';
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement