优质解答
第六道
var s:ansistring;
i,j,k,l,n,t:longint;
begin
readln(s);
l:=length(s);
for i:=2 to l do
begin
if (s[i]=s[i-1]) then s[i]:=2;
if (s[i]=s[i-2]) then begin
delete(s,i,1);
anc(s[i-1]);
end;
end;
writeln(s);
end.
第七道
var s:string;
i,j,n,m,k,l,t:longint;
v:char;
begin
readln(s);
delete(s,2,1);
delete(s,5,1);
delete(s,10,1);
for i:=1 to 9 do begin
t:=(ord(s[i])-48)*i+t;
end;
case t mod 11 of
10:v:='X';
else begin
v:=chr((t mod 11)+48);
end;
end;
if s[10]=v then writeln('Right')
else writeln(s[1],'-',s[2],s[3],s[4],'-',s[5],s[6],s[7],s[8],s[9],'-',v);
end.
第六道
var s:ansistring;
i,j,k,l,n,t:longint;
begin
readln(s);
l:=length(s);
for i:=2 to l do
begin
if (s[i]=s[i-1]) then s[i]:=2;
if (s[i]=s[i-2]) then begin
delete(s,i,1);
anc(s[i-1]);
end;
end;
writeln(s);
end.
第七道
var s:string;
i,j,n,m,k,l,t:longint;
v:char;
begin
readln(s);
delete(s,2,1);
delete(s,5,1);
delete(s,10,1);
for i:=1 to 9 do begin
t:=(ord(s[i])-48)*i+t;
end;
case t mod 11 of
10:v:='X';
else begin
v:=chr((t mod 11)+48);
end;
end;
if s[10]=v then writeln('Right')
else writeln(s[1],'-',s[2],s[3],s[4],'-',s[5],s[6],s[7],s[8],s[9],'-',v);
end.