이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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.size() - 1);
}
std::cout << word << std::endl;
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... |