# 题目

Z：0 1 2 3 4 5 6 7 8 9 10
M：1 0 X 9 8 7 6 5 4 3 2

4
320124198808240056
12010X198901011234
110108196711301866
37070419881216001X

12010X198901011234
110108196711301866
37070419881216001X

2
320124198808240056
110108196711301862

All passed

# 源代码

//C/C++实现
#include <iostream>
#include <string>

using namespace std;

int main(){
int n;
scanf("%d", &n);
string s;
int sum = 0;
char tmp;
bool flag = true;
for(int i = 0; i < n; ++i){
cin >> s;
sum = (s[0] - 48) * 7 + (s[1] - 48) * 9 + (s[2] - 48) * 10 + (s[3] - 48) * 5 +
(s[4] - 48) * 8 + (s[5] - 48) * 4 + (s[6] - 48) * 2 + (s[7] - 48) +
(s[8] - 48) * 6 + (s[9] - 48) * 3 + (s[10] - 48) * 7 + (s[11] - 48) * 9 +
(s[12] - 48) * 10 + (s[13] - 48) * 5 + (s[14] - 48) * 8 + (s[15] - 48) * 4 +
(s[16] - 48) * 2;
switch(sum % 11){
case 0: tmp = '1';break;
case 1: tmp = '0';break;
case 2: tmp = 'X';break;
case 3: tmp = '9';break;
case 4: tmp = '8';break;
case 5: tmp = '7';break;
case 6: tmp = '6';break;
case 7: tmp = '5';break;
case 8: tmp = '4';break;
case 9: tmp = '3';break;
case 10: tmp = '2';break;
}
if(s[17] != tmp){
cout << s << endl;
flag = false;
}
}
if(flag){
printf("All passed\n");
}
return 0;
}