This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <iostream>
#include <string>
int main() {
int n = 0;
scanf(" %d", &n);
std::string word;
while (std::cin >> word) {
if (word.size() % 2 == 1) {
word.erase(--word.end());
}
std::string result;
for (size_t i = 0; i < word.size(); i += 2) {
char a = word[i] - 'a';
char b = word[i + 1] - 'a';
int c = (a + b - n) % 26;
char d = c + 'a';
result.push_back(d);
}
std::cout << result << " ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |