public static void main(String[] args) {
Scanner scanner = new Scanner(
System.in);
String next = scanner.next();
if (next.length() != 2) {
System.out.println("输入值有误");
return;
}
next = new StringBuilder(next).reverse().toString();
StringBuilder result = new StringBuilder();
int lastValue = 1;
for (int i = 0; i < next.length(); i++) {
lastValue = isAZ(next.charAt(i), lastValue, result);
}
System.out.println(result.reverse().toString());
}
private static int isAZ(char inputChar, int isAdd, StringBuilder result) {
if (inputChar < 'A' || inputChar > 'Z') {
System.out.println("输入的字符有误,请输入 A-Z");
return 0;
} else {
if (isAdd == 0) {
result.append(inputChar);
return 0;
}
inputChar++;
if (inputChar > 'Z') {
inputChar = (char) ((inputChar - 65) % 26 + 65);
result.append(inputChar);
return 1;
} else {
inputChar = (char) ((inputChar - 65) % 26 + 65);
result.append(inputChar);
return 0;
}
}
}