답안 #9261

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
9261 2014-09-28T05:06:47 Z dolpang2 Veni, vidi, vici (kriii2_V) C++
0 / 4
0 ms 1676 KB
#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::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 << " ";
  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1676 KB Output is correct
2 Correct 0 ms 1676 KB Output is correct
3 Correct 0 ms 1676 KB Output is correct
4 Correct 0 ms 1676 KB Output is correct
5 Correct 0 ms 1676 KB Output is correct
6 Correct 0 ms 1676 KB Output is correct
7 Incorrect 0 ms 1676 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Halted 0 ms 0 KB -