shizhongxuan @ 2022-03-28 13:04:03
str=input()
ISBN0=list(str)
ISBN1=[]
sum=0
for i in ISBN0:
if i !='-':
ISBN1.append(i) #把字符数字存起来,便于后面计算
for i in range(len(ISBN1)-1):
sum+=int(ISBN1[i])*(i+1)
remainer=sum%11
if remainer==10:
if ISBN0[12]=='X':
print('Right')
else:
ISBN0[12]='X'
for i in ISBN0:
print(i,end='')
elif ISBN0[12]=='X': #python中int()函数不能 对'X'转换字符,所以要把它单独拿出来
ISBN0[12]=('%d'%remainer)
for i in ISBN0:
print(i,end='')
else:
if int(ISBN0[12])==remainer:
print('Right')
else:
ISBN0[12]=('%d'%remainer)
for i in ISBN0:
print(i,end='')