- ISBN号码
- 2009-09-19 11:30:35 @
var
a:array[1..13] of char;
i,j,k,s:integer;
b:array[1..10] of integer;
begin
for i:=1 to 13 do read(a[i]);
j:=0;
for i:=1 to 10 do begin
inc(j);
if a[j]'-' then if a[j]'X' then
b[i]:=ord(a[j])-48
else b[i]:=10
else begin
b[j]:=ord(a[j+1])-48;
inc(j)
end
end;
s:=0;
for i:=1 to 9 do
s:=s+b[i]*i;
k:=s mod 11;
if k=b[10] then write('Right')
else begin
for i:=1 to 12 do write(a[i]);
if k=10 then write('X')
else write(k);
end;
end.
0 条评论
目前还没有评论...