Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- std::string reverse(std::string& input) { return std::string(input.rbegin(), input.rend()); }
- int main() {
- std::string str;
- printf("please enter your string:");
- std::getline(std::cin, str);
- std::cout << "[~] string: \"" << str << "\"" << std::endl;
- std::cout << "[~] rstr : \"" << reverse(str) << "\"" << std::endl;
- std::cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement