python两组数据ER,本地编译器能过

P1055 [NOIP2008 普及组] ISBN 号码

kugua @ 2021-07-20 22:54:10

s = input() 
le = len(s) 
j = 1
sum = 0
for i in range(le - 1):
    if(s[i] != '-'):
        sum += (int(s[i])*j )
        j += 1 
sum %= 11 
if(s[-1] == "X"):
    num = 10 
else:
    num = int(s[-1]) 

if(sum == num):
    print("Right")
else:
    for i in range(le-1):
        print(s[i],end="")
    if(sum == 10):
        print("X") 
    else:
        print(str(sum))

6-670-82162-X 错误的样例 本地编译器能过


by oldove_laotofu @ 2021-08-10 14:08:53

我用py也是这种情况……

这是人性的泯灭,还是……


by oldove_laotofu @ 2021-08-10 14:10:27

@kugua 而且我不会c++……完蛋了


|