level 7
先睡觉😪再说
楼主
var
c,b,i,d,ans:integer;
g,s:string;
function t(c:char):integer;
begin
case c of
*0*:t:=0;
*1*:t:=1;
*2*:t:=2;
*3*:t:=3;
*4*:t:=4;
*5*:t:=5;
*6*:t:=6;
*7*:t:=7;
*8*:t:=8;
*9*:t:=9;
else t:=10;
end;
begin
assign(input,*isbn.in*);
reset(input);
assign(output,*isbn.out*);
rewrite(output);
d:=1;
ans:=0;
read(s);
i:=length(s);
for b:=1 to i do
if (s[b]>=*0*) and (s[b]<=*9*) then begin
ans:=ans+t(s[b])*d;
d:=d+1;
end;
ans:=ans mod 11;
delete(s,i,1);
str(ans,g);
concat(s,g);
if t(s[i])=ans then write(*right*)
else write(s);
close(input);
close(output);
end.
哪里错了??????!!!
2014年10月31日 03点10分
1
c,b,i,d,ans:integer;
g,s:string;
function t(c:char):integer;
begin
case c of
*0*:t:=0;
*1*:t:=1;
*2*:t:=2;
*3*:t:=3;
*4*:t:=4;
*5*:t:=5;
*6*:t:=6;
*7*:t:=7;
*8*:t:=8;
*9*:t:=9;
else t:=10;
end;
begin
assign(input,*isbn.in*);
reset(input);
assign(output,*isbn.out*);
rewrite(output);
d:=1;
ans:=0;
read(s);
i:=length(s);
for b:=1 to i do
if (s[b]>=*0*) and (s[b]<=*9*) then begin
ans:=ans+t(s[b])*d;
d:=d+1;
end;
ans:=ans mod 11;
delete(s,i,1);
str(ans,g);
concat(s,g);
if t(s[i])=ans then write(*right*)
else write(s);
close(input);
close(output);
end.
哪里错了??????!!!