Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program tam_hau;
- Procedure Try(j);
- begin
- For i:=1 to 8 do
- If (a[i] and b[i+j] and c[i-j]) then
- begin
- {đặt quân hậu}
- x[i]:=i; a[i]:=false; b[i+j]=false; c[i-j]=false;
- If i<8 then try(j+1)
- else {in quân hậu}
- for k:=1 to n do write(x[k]:5);
- {cất quân hậu}
- a[i]:=true; b[i+j]=true; c[i-j]=true;
- end;
- end;
- BEGIN
- for i:=1 to 8 do a[i]:=true;
- for i:=2 to 16 do b[i+j]:=true;
- for i:=-7 to 7 do c[i-j]:=true;
- Try(1);
- readln
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement