You are viewing a single comment's thread. Return to all comments →
In C++
string caesarCipher(string s, int k) { for (int i = 0; i < s.size(); i++) { if (isalpha(s[i])) { char base = islower(s[i]) ? 'a' : 'A'; s[i] = base + (s[i] - base + k) % 26; } } return s; }
Seems like cookies are disabled on this browser, please enable them to open this website
Caesar Cipher
You are viewing a single comment's thread. Return to all comments →
In C++