Advertisement
sheredega

Task #10

Dec 10th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cout << "Enter the number of words: ";
  8.     cin >> n;
  9.     string* array = new string [n];
  10.     cout << "Enter your words\n";
  11.     for (int i = 0; i < n; i++) {
  12.         cin >> array[i];
  13.     }
  14.     cout << "Your reverse array of words:\n";
  15.     for (int i = n-1; i >= 0; i--) {
  16.         cout << array[i] << " ";
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement