#include "library.h" const string alpha = "abcdefghijklmnopqrstuvwxyz "; const string other = "hzbdowumrjgaqitvenypcskxfl "; int find(const char c, const string s, const int pos) { if (pos >= s.length()) return -1; if (s[pos] == c) return pos; return find(c, s, pos + 1); } string encrypt(const string s) { if (s == "") return ""; const char c = s[0]; const int pos = find(c, alpha, 0); const char rep = other[pos]; return string(rep) + encrypt(s.substr(1)); } void main() { cout << "Enter a string: "; const string s = read_line(); const string t = encrypt(s); cout << "Encrypted = " << t << "\n"; }