测试数据下载后测试正确,但就是不能AC,困惑!

P1055 [NOIP2008 普及组] ISBN 号码

VivianYW @ 2022-04-05 17:30:53

a = input().split('-')
a1 = list(map(int, a[0]))
a2 = list(map(int, a[1]))
a3 = list(map(int, a[2]))
a0 = a1 + a2 + a3
sbm = list(map(lambda x, y: x * y, a0, list(range(1, 10))))
s = sum(sbm) % 11
if s == 10:
    ss = "X"
else:
    ss = str(s)
if ss == a[3]:
    print("Right")
else:
    isbn = a[0] + "-" + a[1] + "-" + a[2] + "-" + ss
    print(isbn)

|