在这里插入代码片
```s = input()
s1 = s
s = list(s)
s1 = list(s1)
s2 = ""
n = len(s)
m = 0
while n != 0:
if '-' in s:
s.remove('-')
n = n - 1
for i in range(len(s)-1):
s[i] = int(s[i])
m = m + s[i] * (i + 1)
m1 = m % 11
if str(m1) == s[-1]:
print("Right")
elif m1 == 10 and s[-1] == 'X':
print("Right")
else:
if m1 == 10:
s1.pop()
s1.append('X')
print(s2.join(s1))
else:
s1.pop()
s1.append(str(m1))
print(s2.join(s1))
刚刚入门Python,用CCF的题来练习,小白一个,代码写的不够简洁,请大神多多指教
CCF ISBN号码 python
最新推荐文章于 2023-09-20 16:52:05 发布