import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); // 注意 hasNext 和 hasNextLine 的区别 while (in.hasNextInt()) { // 注意 while 处理多个 case int num = in.nextInt(); switch(num){ case 200: System.out.println("OK"); break; case 202: System.out.println("Accepted"); break; case 400: System.out.println("Bad Request"); break; case 403: System.out.println("Forbidden"); break; case 404: System.out.println("Not Found"); break; case 500: System.out.println("Internal Server Error"); break; case 502: System.out.println("Bad Gateway"); break; } } } }