Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cout << "Enter the number of words: ";
- cin >> n;
- string* array = new string [n];
- cout << "Enter your words\n";
- for (int i = 0; i < n; i++) {
- cin >> array[i];
- }
- cout << "Your reverse array of words:\n";
- for (int i = n-1; i >= 0; i--) {
- cout << array[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement