Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string atbash(std::string str) {
- for (std::string::iterator it = str.begin(); it != str.end(); ++it)
- if ('A' <= *it and *it <= 'Z' or 'a' <= *it and *it <= 'z')
- *it = 25 - *it + (('a' <= *it) ? 2 * 'a' : 2 * 'A');
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment