题解 | #HTTP状态码#
HTTP状态码
http://www.nowcoder.com/practice/99dba043761e43c2a6f931e2c5c247c7
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()) { int num = sc.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; } } } }