Start: Jul, 06, 2019 10:00:00
20190706Python程序设计基础培训扩展练习
End: Jul, 17, 2019 12:00:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 48ms
Memory: 25200kB
Author: shanzhenyu
In contest: 1300

while True:
    try:
        isbn = input().split('-')
        isbn_str = ''.join(isbn)
        total = 0
        for i in range(len(isbn_str)-1):
            total += (i+1)*int(isbn_str[i])
        chk = 'X' if total%11 == 10 else str(total%11)
        if chk == isbn_str[-1]:
            print('Right')
        else:
            for i in range(len(isbn)-1):
                print(isbn[i],end='-')
            print(chk)
    except EOFError:
        break