Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void swap(char&sym_1, char&sym_2) {
- char temp = sym_1;
- sym_1 = sym_2;
- sym_2 = temp;
- }
- void flip(std::string&str) {
- for (int i = 0, j = str.size()-1; i < (int)(str.size() / 2); i++, j--) {
- swap(str[i], str[j]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment