#include <iostream>
#include <string>
int main()
{
std::string str = "";
std::cout << "Please enter a string to be reversed: ";
std::getline(std::cin, str);
std::cout << "Before: " << str << '\n'
<< "After: " << std::string(str.rbegin(), str.rend()) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKaW50IG1haW4oKQp7CiAgICBzdGQ6OnN0cmluZyBzdHIgPSAiIjsKCiAgICBzdGQ6OmNvdXQgPDwgIlBsZWFzZSBlbnRlciBhIHN0cmluZyB0byBiZSByZXZlcnNlZDogIjsKICAgIHN0ZDo6Z2V0bGluZShzdGQ6OmNpbiwgc3RyKTsKCiAgICBzdGQ6OmNvdXQgPDwgIkJlZm9yZTogIiA8PCBzdHIgPDwgJ1xuJwogICAgICAgICAgICAgICAgICA8PCAiQWZ0ZXI6ICIgPDwgc3RkOjpzdHJpbmcoc3RyLnJiZWdpbigpLCBzdHIucmVuZCgpKSA8PCBzdGQ6OmVuZGw7CgogICAgcmV0dXJuIDA7Cn0=