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;
int count = 0;
while (std::cin >> word) {
std::string converted;
if (word.size() % 2 == 1) {
for (size_t i = 0; i < word.size() - 1; ++i) {
converted.push_back(word[i]);
}
} else {
converted = word;
}
std::string ret;
for (size_t i = 0; i < converted.size(); i += 2) {
char a = converted[i] - 'a';
char b = converted[i + 1] - 'a';
int c = (a + b - n) % 26;
char d = c + 'a';
ret.push_back(d);
}
if (count != 0) {
std::cout << " ";
}
std::cout << ret;
++count;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |