//ic210 section 4002 //hw 23 //Write a program that reads a number n from the user, //reads an n-word sentence from the user, and then //prints out the sentence in reverse (but not the words). //A typical run of the program might look like this: // //Number of words: 3 //Sentence: I am dumb //dumb am I #include #include using namespace std; int main() { int n; // Get num of words from user cout << "How many words? "; cin >> n; string *myArray; myArray = new string[n]; // Read words cout << "Enter the sentnce" ; for(int i = 0; i < n; i++) cin >> myArray[i]; // Output in reverse cout << "In reverse your sentence is: "; for(int j = n - 1; j >= 0; j--) cout << myArray[j] << " "; cout << endl; return 0; } // end main