📄 八皇后.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://www.xm818.com/noi/html/olpcbahanghou.htm -->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><HTML><HEAD><TITLE>八皇后</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>TD {
FONT-SIZE: 12px; COLOR: #333333; LINE-HEIGHT: 150%
}
A {
COLOR: #333333; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff6600; TEXT-DECORATION: underline
}
.linkA A:link {
COLOR: #333333; TEXT-DECORATION: underline
}
.linkA A:visited {
COLOR: #333333; TEXT-DECORATION: underline
}
.linkA A:hover {
COLOR: #ff6600; TEXT-DECORATION: none
}
.linkB A {
COLOR: #0396e4; TEXT-DECORATION: none
}
.linkB A:hover {
COLOR: #ff6600; TEXT-DECORATION: none
}
INPUT {
FONT-SIZE: 12px
}
SELECT {
FONT-SIZE: 12px
}
.style1 {
COLOR: #ff0000
}
.style2 {
COLOR: #0000ff
}
.style3 {
COLOR: #0000ff
}
</STYLE>
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width=768 background=八皇后_files/BG.jpg
border=0>
<TBODY>
<TR>
<TD background=八皇后_files/main_top.gif height=102>
<DIV align=right>
<TABLE id=table1 cellSpacing=0 cellPadding=0 width=180 border=0>
<TBODY>
<TR>
<TD width=146 colSpan=2 height=17>
<P align=center><U><B><FONT
color=#0000ff>联系方式</FONT></B></U></P></TD></TR>
<TR>
<TD width=90 height=17>QQ:<FONT color=#0000ff>76455837</FONT></TD>
<TD width=90 height=17>
<P align=center><A
href="http://wpa.qq.com/msgrd?V=1&Uin=76455837&Site=厦门八一八&Menu=yes"
target=blank><IMG alt=请留言。。。 src="八皇后_files/10_online.gif"
border=0></A></P></TD></TR>
<TR>
<TD width=146 colSpan=2 height=17>MSN:<FONT
color=#0000ff>root@xm818.com</FONT></TD></TR>
<TR>
<TD width=146 colSpan=2 height=17>E_MAIL:<FONT
color=#0000ff>root@xm818.com</FONT></TD></TR></TBODY></TABLE></DIV></TD></TR>
<TR>
<TD height=56>
<OBJECT id=obj1
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0
height=56 width=768 border=0
classid=clsid:D27CDB6E-AE6D-11CF-96B8-444553540000><PARAM NAME="movie" VALUE="../images/noitop.swf"><PARAM NAME="quality" VALUE="High">
<embed src="../images/noitop.swf"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" name="obj1" width="768" height="56"
quality="High"></OBJECT></TD></TR>
<TR>
<TD background=八皇后_files/main_center.gif height=45>
<DIV align=center>
<DIV align=center>
<TABLE id=table2 height="100%" cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD>
<P align=center><FONT color=#ffffff>〓 〓 八皇后 〓 〓</FONT></P></TD></TR>
<TR>
<TD height=18>
<P align=center></P></TD></TR></TBODY></TABLE></DIV></DIV></TD></TR>
<TR>
<TD>
<DIV align=left>
<DIV align=left><SPAN
class=style3>【问题描述】</SPAN>在一个8×8格子的棋盘上,要布局八个皇后,条件是不能出现两个皇后在同一行或同一列或同一斜线的情况,以防“相互攻击”,请问共有多少种合理的布局方式,每一种布局的具体情况如何?<BR><SPAN
class=style3>【分析】</SPAN>显然问题的键在于如何判定某个皇后所在的行、列、斜线上是否有别的皇后;可以从矩阵的特点上找到规律,如果在同一行,则行号相同;如果在同一列上,则列号相同;如果同在/
斜线上的行列值之和相同;如果同在\
斜线上的行列值之差相同;如果斜线不分方向,则同一斜线上两皇后的行号之差的绝对值与列号之差的绝对值相同。从下图可以验证上面的说法: </DIV>
<TABLE id=table4 height=215 width=300>
<TBODY>
<TR>
<TD width=33 height=23>
<DIV align=center></DIV></TD>
<TD width=33 height=23>
<DIV align=center>1</DIV></TD>
<TD width=33 height=23>
<DIV align=center>2</DIV></TD>
<TD width=33 height=23>
<DIV align=center>3</DIV></TD>
<TD width=33 height=23>
<DIV align=center>4</DIV></TD>
<TD width=33 height=23>
<DIV align=center>5</DIV></TD>
<TD width=33 height=23>
<DIV align=center>6</DIV></TD>
<TD width=33 height=23>
<DIV align=center>7</DIV></TD>
<TD width=34 height=23>
<DIV align=center>8</DIV></TD></TR>
<TR>
<TD height=24>
<DIV align=center>1</DIV></TD>
<TD colSpan=8 rowSpan=8>
<TABLE id=table5 borderColor=#990000 border=1>
<TBODY>
<TR>
<TD width=32 height=27>
<DIV align=center> </DIV></TD>
<TD width=32 height=27>
<DIV align=center> </DIV></TD>
<TD width=32 height=27>
<DIV align=center> </DIV></TD>
<TD width=32 height=27>
<DIV align=center>|</DIV></TD>
<TD width=32 height=27>
<DIV align=center> </DIV></TD>
<TD width=33 height=27>
<DIV align=center> </DIV></TD>
<TD width=33 height=27>
<DIV align=center> </DIV></TD>
<TD width=33 height=27>
<DIV align=center>/</DIV></TD></TR>
<TR>
<TD height=27>
<DIV align=center>\</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center>|</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center>/</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD></TR>
<TR>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center>\</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center>|</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center>/</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD></TR>
<TR>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
<DIV align=center>\</DIV></TD>
<TD height=27>
<DIV align=center>|</DIV></TD>
<TD height=27>
<DIV align=center>/</DIV></TD>
<TD height=27>
<DIV align=center> </DIV></TD>
<TD height=27>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -