为什么只有40?求大佬<.*?>

P1055 [NOIP2008 普及组] ISBN 号码

iberry @ 2021-11-21 16:05:35

numlist=list(input())

sum=0

sumlist=[]

quan=[1,2,3,4,5,6,7,8,9]

m=["0","1","2","3","4","5","6","7","8","9","x"]

for i in numlist:

if "-" !=i:
    sumlist.append(i)

for j in range(9):

sum+=quan[j]*int(sumlist[j])

if m[sum%11]==numlist[-1]:

print("Right")

else:

numlist[-1]=m[sum%11]

print(''.join(numlist))

|