满江红求助

P1055 [NOIP2008 普及组] ISBN 号码

flyloong @ 2023-07-17 14:01:34

Python3 听取wa声一片 求教

nums = []
t    = input()
nums = t.split('-')
del t
strs = nums[0] + nums[1] + nums[2]
a = 1
for i in range(len(strs)):
    a *= int(strs[i])

if a % 11 == nums[3]:
    print('Right')
else:
    print(str(a % 11))

by cff_0102 @ 2023-07-17 14:11:49

@flyloong 你算的是n[0]n[1]*n[2]*n[3]*...,实际上应该算n[0]*1+n[1]\2+...


by flyloong @ 2023-07-17 15:02:40

@cff_0102 谢谢dalao


|