题解 | #HTTP状态码#
HTTP状态码
https://www.nowcoder.com/practice/99dba043761e43c2a6f931e2c5c247c7
#include <stdio.h> int main() { int a; while (scanf("%d", &a) != EOF) { // 注意 while 处理多个 case // 64 位输出请用 printf("%lld") to switch (a) { case 200: printf("OK\n"); break; case 202: printf("Accepted\n"); break; case 400: printf("Bad Request\n"); break; case 403: printf("Forbidden\n"); break; case 404: printf("Not Found\n"); break; case 500: printf("Internal Server Error\n"); break; case 502: printf("Bad Gateway\n"); break; } } return 0; }