题解 | #HTTP状态码#
HTTP状态码
http://www.nowcoder.com/practice/99dba043761e43c2a6f931e2c5c247c7
#include <stdio.h>
int main() { int http = 0;
while (scanf("%d", &http) != EOF)
{
if (http == 200)
printf("OK\n");
else if (http == 202)
printf("Accepted\n");
else if (http == 400)
printf("Bad Request\n");
else if (http == 403)
printf("Forbidden\n");
else if (http == 404)
printf("Not Found\n");
else if (http == 500)
printf("Internal Server Error\n");
else
printf("Bad Gateway\n");
}
return 0;
}