文章

1

粉丝

117

获赞

0

访问

8.4k

头像
关于这道题的两个bug
P1722 北京理工大学2017年机试题
发布于2021年3月6日 16:56
阅读数 8.4k

首先这个题的输入输出的x对应的大小写不一样

其次输出正确的单词Correct打成了Corrent

浪费了我一下午的时间 人有点晕。


#include <bits/stdc++.h>
using namespace std;


int main()
{
    char s[99];
    char rule[99] = {'1','0','X','9','8','7','6','5','4','3','2'};
    int weight[99] = {7 ,9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
    int x,y;
    while(scanf("%s",&s) !=EOF){
        int f = 0;
        if(strlen(s)!=18){
            cout << "ID Wrong" <<endl;
        }
        else{
            for(int i=0;i<=16;i++){
                f += (s[i]-48)*weight[i];
            }
          &...

登录查看完整内容


登录后发布评论

1 条评论
admin SVIP
2021年3月6日 19:50

出题人故意的,以后读题要仔细啊laugh

赞(0)