8 solutions

  • 0
    @ 2021-10-17 15:17:38

    def checkIDNumber(num): xishu = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2]#17个 weihao= [1,0,'X',9,8,7,6,5,4,3,2]#11个 ls=list(map(int,num[:17])) qiuhe=list(map(lambda x,y:x*y,xishu,ls)) temp=sum(qiuhe)%11 if num[17]==str(weihao[temp]): print('True') else: print('False')
    if name == 'main': data=[] n=input() #总共个数 for i in range(int(n)): a=input()#身份证号码 data.append(a) for x in range(len(data)): checkIDNumber(data[x])

    Information

    ID
    41
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    1800
    Accepted
    230
    Uploaded By