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