Help me, please I got WR
Help me, please I got WR, but all test that is in message board is
O.K!!!
-------------------THAT IS MYPROGRAM--------------------------------
type
PointType = record
X,Y:byte;
end;
var a:array[0..11,0..11]of byte;
s1,s2:array[1..100]of pointtype;
h1,h2,N,i,j,x,y:integer;
bol:boolean;
procedure go(x,y:integer;ch:Char);
begin
if a[x,y] = 1 then
begin
inc(h2);
s2[h2].x:=x;s2[h2].y:=y;a[x,y]:=2;
write(ch);
end;
end;
begin
read(n);
for i:=1 to N do
begin
read(x,y);
a[x,y]:=1;
end;
x:=11;y:=11;bol:=false;
for i:=1 to 10 do
begin
for j:=1 to 10 do if (a[i,j] = 1) then
begin
x:=i;y:=j;bol:=true;break;
end;
if bol then break;
end;
writeln(x,' ',y);
s1[1].x:=x;s1[1].y:=y;a[x,y]:=2;
h1:=1;
while true do
begin
h2:=0;
for i:=1 to h1 do
begin
go(s1[i].x+1,s1[i].y,'R');
go(s1[i].x,s1[i].y+1,'T');
go(s1[i].x-1,s1[i].y,'L');
go(s1[i].x,s1[i].y-1,'B');
if (i=h1)and(h2=0)then write('.') else writeln(',');
end;
if h2 = 0 then break;
for i:=1 to h2 do s1[i]:=s2[i];
h1:=h2;
end;
end.