weight = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2]
M = ['1','0','X','9','8','7','6','5','4','3','2']
N=int(input())
a = True#all is ok
b = True#this one is ok
for i in range(N):
s = input()
z = 0
b = True
for j in range(17):
if ord(s[j]) not in range(48,58):
print(s)
a = False
b = False
break
else:
z = z + weight[j]*int(s[j])
z = z%11
if M[z] != s[17] and b == True:
print(s)
a = False
if a == True:
print('All passed')
第3章-2 查验身份证
最新推荐文章于 2022-09-14 10:21:14 发布