题解 | #HTTP状态码#

HTTP状态码

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

#include <stdio.h>

int main() {
    int i,temp;
    int a[]={200,202,400,403,404,500,502};
    char *b[]={"OK","Accepted","Bad Request","Forbidden","Not Found","Internal Server Error","Bad Gateway"}; 
    while((scanf("%d",&i)!=EOF))
    {
        if(getchar()=='\n')
        {
            for(temp=0;temp<7;temp++)
            {
                if(a[temp]==i)
                {
                    printf("%s\n",b[temp]);
                }
            }
        }
    }
    return 0;
}
全部评论

相关推荐

牛客62533758...:华为不卡双非,而是卡院校hhhh
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务