7-15 查验身份证 (15分)
def Check(x):
M = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
Q = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
m=x[-1]
x=x[:17]
s=j=0
for i in x:
if i<='9' and i>='0':
s+=int(i)*Q[j]
j+=1
else :
return False
z=s%11
if M[z]==m:
return True
else :
return False
n=int(input())
cnt=0
for i in range(n):
lst=input()
if not Check(lst):
print(lst)
else :
cnt+=1
if cnt==n:
print("All passed")