tangweichen 2014-03-22 04:59:15
点我顶贴
收藏
删除
var a,b,l:string;
i,s,k:integer;
t:array[1..9]of integer;
begin
read(a);
for i:=1 to 13 do
if a[i]<>'-' then b:=b+a[i];
for i:=1 to 9 do
val(b[i],t[i],k);
for i:=1 to 9 do
s:=s+t[i]*i;
s:=s mod 11;
str(s,l);
if l=b[10] then write('Right')
else
if (b[10]='X') and (s=10) then write('Right')
else if s=10 then
write(copy(a,1,12),'X')
else
write(copy(a,1,12),s);
end.