F_Suzichen @ 2022-12-21 17:35:34
a=input()
t=a.replace('-','')
t=list(t)
n=len(t)
#print(n)
for i in range(n-1):
t[i]=int(t[i])
sum=0
for i in range(n-1):
sum=sum+t[i]*(i+1)
x=sum%11
#print(x)
if x==10:
x='X'
x=str(x)
if x==a[len(a)-1]:
print('Right')
else:
a=a[:-1]+str(x)
print(a)
by nanhanpu @ 2022-12-24 16:12:44
代码没问题,两个for循环没必要,我觉得这就是超时的原因