BC76 [NOIP2008]ISBN号码

思路:

step1:按照要求编写即可;就是emm好麻烦emmmmmm;

代码如下:

n = input()
a = n[0]
b = n[2]
c = n[3]
d = n[4]
e = n[6]
f = n[7]
g = n[8]
h = n[9]
i = n[10]
j = n[12]
res = int(a)*1 + int(b)*2 + int(c)*3 + int(d)*4 + int(e)*5 + int(f)*6 + int(g)*7 + int(h)*8 + int(i)*9
res1 = int(res) % 11
if j == 'X':
    if res1 == 10:
        res2 = 'X'
        if res2 == j:
            print('Right')
        else:
            print('{}-{}{}{}-{}{}{}{}{}-X'.format(a,b,c,d,e,f,g,h,i))
    else:
        print('{}-{}{}{}-{}{}{}{}{}-{}'.format(a,b,c,d,e,f,g,h,i,res1))
else:
    if res1 == int(j):
        print('Right')
    else:
        if res1 == 10:
            print('{}-{}{}{}-{}{}{}{}{}-X'.format(a,b,c,d,e,f,g,h,i))
        else:
            print('{}-{}{}{}-{}{}{}{}{}-{}'.format(a,b,c,d,e,f,g,h,i,res1))