This repository has been archived on 2024-08-23. You can view files and clone it, but cannot push or open issues or pull requests.
lessons/C++/lesson2/task10.cpp
2023-07-16 13:23:25 +00:00

18 lines
357 B
C++

#include <iostream>
#include <string>
int main() {
std::string value = std::string();
std::cin >> value;
int offset;
std::cin >> offset;
offset = offset % 26 - 'A';
for (char& c : value) {
if (c > 'Z' || c < 'A') {
continue;
}
c = (c + offset) % 26 + 'A';
}
std::cout << value << '\n';
}