NOIP2008T1 ISBN

 

 

var a,c,RES:string;
    i,m,b:longint;
    v:char;
begin
    assign(input,'isbn.in'); reset(input);
    assign(output,'isbn.out'); rewrite(output);
    readln(a);
    c:=a;
    delete(a,2,1); delete(a,5,1); delete(a,10,1);
    for i:=1 to 9 do m:=m+(ord(a[i])-48)*i;
    m:=m mod 11;
    if m<10 then
        if c[13]=chr(m+48) then c:='Right' else c[13]:=chr(m+48);
    if m=10 then
        if c[13]='X' then c:='Right' else c[13]:='X';
    writeln(c);
    close(input); close(output);
end.

 

posted @ 2013-10-26 16:55  qilinart  阅读(131)  评论(0)    收藏  举报