1234567891011121314151617
#include <algorithm> #include <iostream> #include <string> int main() { std::string buffer; std::cout << "Enter a string to see it in reverse: "; std::getline(std::cin, buffer); std::reverse(buffer.begin(), buffer.end()); std::cout << buffer << std::endl; return 0; }