Guest User

Other Solution

a guest
Feb 28th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. std::string atbash(std::string str) {
  2.     for (std::string::iterator it = str.begin(); it != str.end(); ++it)
  3.         if ('A' <= *it and *it <= 'Z' or 'a' <= *it and *it <= 'z')
  4.             *it = 25 - *it + (('a' <= *it) ? 2 * 'a' : 2 * 'A');
  5.     return str;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment