Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- int main() {
- std::string alp(26, ' ');
- for (int i = 0; i < 26; i++) {
- alp[i] = static_cast<char>('A' + i);
- }
- std::string str = "UII QUXSCUQCVPACFULQVCXFCHIICBIAHQ LAQ";
- std::string result;
- for (size_t i = 0; i < str.size(); i++) {
- int y = str[i] == ' ' ? 26 : str[i] - 'A';
- int x = (11 * (y - 7)) % 27;
- if (x < 0) {
- x = 27 + x;
- }
- result += x == 26 ? ' ' : alp[x];
- }
- std::cout << result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement