题解 | #HTTP状态码#

HTTP状态码

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

#include <stdio.h>

int main() {
    unsigned int n = 0;

    while (~scanf("%u", &n))
    {
        switch (n)
        {
            case 200:
                printf("OK");
                break;
            case 202:
                printf("Accepted");
                break;
            case 400:
                printf("Bad Request");
                break;
            case 403:
                printf("Forbidden");
                break;
            case 404:
                printf("Not Found");
                break;
            case 500:
                printf("Internal Server Error");
                break;
            case 502:
                printf("Bad Gateway");
                break;        
        }
        printf("\n");
    }
    return 0;
}

全部评论

相关推荐

10-06 12:46
门头沟学院 Java
跨考小白:定时任务启动
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务