- 马拦过河卒
- 2009-08-05 11:02:23 @
program lx;
const
dx :array[1..8]of integer=(-2,-2,-1,1,2,2,1,-1);
dy :array[1..8]of integer=(-1,1,2,2,1,-1,-2,-2);
var
a :array[0..16,0..16]of longint;
i,j :longint;
c,d :longint;
x1,x2 :longint;
y1,y2 :longint;
tx,ty :longint;
procedure search(x,y:longint);
begin
if (x=x1) and(y=y1) then begin
inc(c);
for i:=0 to 15 do begin
for j:=0 to 15 do begin
write(a:2);
end;
writeln;
end;
writeln;
exit;
end;
if a[x,y]=2 then begin
exit;
end;
a[x,y]:=1;
if (x+1=0) then
search(x+1,y)
else exit;
if (y+1>=0)and (y+1=0) and (tx=0) and(ty
1 条评论
-
杨斌 LV 8 @ 2009-08-05 22:34:03
恭喜AC啦
- 1