#include #include #include #include using namespace std; int main() { string input, inputWord, reversedInput = ""; vector inputWords; stringstream ss(input); cout << "Enter the phrase: " << endl; getline(cin, input); while (ss >> inputWord) { inputWords.push_back(inputWord); } for (int i = inputWords.size() - 1; i >= 0; i--) { reversedInput += inputWords[i] + " "; } reversedInput.pop_back(); cout << "Output: " << endl << reversedInput << endl; return 0; }