Answer:
//Include this header file if program is executing on //visual studio.
#include "stdafx.h";
//Include the required header file.
#include <iostream>
#include <string>
//Use the standard namespace.
using namespace std;
//Define the function rcopy.
void rcopy()
{
//Declare a string variable to store the string.
string s;
//Prompt the user to input the string.
cin >> s;
//Check if the string entered by the user reach to
//the next line character.
if (cin.get() == '\\')
{
//Display the last word in the string.
cout << s << " ";
//Return from the if statement.
return;
}
//Make a recursive call to the function rcopy.
rcopy();
//Display the remaining words in the string in
//the reverse order.
cout << s << " ";
}
//Start the execution of the main method.
int main()
{
//Call the function rcopy.
rcopy();
//Use this system command to hold the console screen //in visual studio.
system("pause");
//Return an integer value to the main function.
return 0;
}
Step-by-step explanation:
See attached images for the code and output