PKU 1298 "The Hardest Problem Ever"
問題:http://acm.pku.edu.cn/JudgeOnline/problem?id=1298
順位:http://acm.pku.edu.cn/JudgeOnline/problemstatus?problem_id=1298&orderby=clen&language=2
提出コード(232B)
import java.util.*;class Main{static{for(Scanner s=new Scanner(System.in);s.nextLine().equals("START");s.nextLine()){for(int c:s.nextLine().toCharArray())System.out.print((char)(64<c&&c<91?c+(c<70?21:-5):c));System.out.println();}}}
整形コード
class Main { static { for (Scanner s = new Scanner(System.in); s.nextLine().equals("START"); s .nextLine()) { for (int c : s.nextLine().toCharArray()) System.out.print((char) (64 < c && c < 91 ? c + (c < 70 ? 21 : -5) : c)); System.out.println(); } } }