python3,请各位大佬看看,我ac了2个,测试数据我都是对的,我比较菜
查看原帖
python3,请各位大佬看看,我ac了2个,测试数据我都是对的,我比较菜
526856
Quarkqe楼主2021/9/6 10:21
s = list(input())
#     需要的索引号
a = [0, 2, 3, 4, 6, 7, 8, 9, 10]
t = 0
for i in range(0, 9):
    t = t + int(s[a[i]]) * (i + 1)
if t % 11 == int(s[12]):
    print("Right")
else:
    del s[-1]
    s.append(t % 11)
    print("{}-{}{}{}-{}{}{}{}{}-{}".format(s[0], s[2], s[3], s[4], s[6], s[7], s[8], s[9], s[10],
                                           s[12]))
2021/9/6 10:21
加载中...