题解 | #HTTP状态码#

HTTP状态码

https://www.nowcoder.com/practice/99dba043761e43c2a6f931e2c5c247c7

#include <stdio.h>
int main()
{
	int a = 0;
    while(scanf("%d", &a)!=EOF)
		if (a >= 100 && a <= 600)
		{
			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;
			default:
				printf("不存在\n");
				break;
		    }
	    }
	return 0;
 }

全部评论

相关推荐

牛客771574427号:恭喜你,华杰
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务