讨论 / FREE PASCAL题解
jimmy_qian 2012-08-28 05:42:00
点我顶贴 收藏 删除
var

c:char;

tot,i,j:longint;

s:string;

begin

assign(input,'isbn.in'); reset(input);

assign(output,'isbn.out'); rewrite(output);

read(s);

tot:=0;

j:=1;

for i:=1 to 11 do if s[i] in ['0'..'9'] then begin

inc(tot,(ord(s[i])-48)*j);

inc(j);

end;

tot:=tot mod 11;

if tot=10 then c:='X' else c:=chr(tot+48);

if c=s[13] then writeln('Right')

else begin

s[13]:=c;

writeln(s);

end;

close(input); close(output);

end.

无压力飘过~~

#1 刘载清@2012-08-28 05:42:00
回复 删除
加文件干嘛?

文件不要加的……

查看更多回复
提交回复