原题
http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1§ionid=2&problemid=21
源码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
byte[] temp;
String c = in.nextLine();
int lines = Integer.parseInt(c);
for (int i = 1; i <= lines; i++) {
temp = in.nextLine().getBytes();
StringBuilder sb = new StringBuilder();
for (int j = 0; j < temp.length; j++) {
if (temp[j] == 'Z') {
temp[j] = 'A';
} else {
++temp[j];
}
sb.append((char) temp[j]);
}
System.out.println("String #" + i);
// 会出现 Presentation Error 错误
// System.out.println(sb.toString()+"\n");
System.out.println(sb.toString());
System.out.println();
}
}
}