文件名称:bahuanghou
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.91mb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
摘 要
本设计的内容是在一个八行八列的国际棋盘上,放置八个皇后,要求在任意一行,任意一列及任意一条对角线上都不能出现两个棋子。
本设计所涉及到的程序设计语言是VC++,采用的是递归和回溯的方法。首先在棋盘上找到一个位置,放置其中的一个皇后,然后对该皇后进行检查,查看她是否与棋盘同一行、同一列或同一斜线上已存在的皇后发生冲突。如果该皇后与棋盘上已经存在的皇后不发生冲突,则该皇后就摆放在此位置,继续试探下一个皇后的合适的位置;如果该皇后与棋盘上已经存在的皇后反生冲突,则该皇后就不能放在此位置,继续试探此皇后的下一个位置。直到将八个皇后都放到棋盘上,则问题解决。通过以上的方法对本课设题目进行设计与调试最后成功的输出了八皇后所有的92中合理布局,完成了设计题目的要求。
关 键 词:递归算法,八皇后,回溯法,VC++
-Abstract
The design of the content is in a line of eight international board, placed on any requirement, eight queen, any column and any diagonals cannot appear on two pieces.
This design involves the programming language is used, vc++ is recursive and back. First find a position on board, and placed in one of the queen, then the queen to inspect, check whether she and board with the same column or the same line, the queen of the existing cross-court conflict. If the queen and board existing queen not conflict, the queen will put in this position, continue to test a queen s place, If the queen on board with the queen the already existing conflict, the queen was born in this position, can continue to test the queen s next position. Until eight queen on board, problem solving. Through the above method for this class set subject designing and debugging of the output of the 92 8queens all reasonable layout, completed the design set the topic request.
Keywords: Recursive algorithm,Eight
本设计的内容是在一个八行八列的国际棋盘上,放置八个皇后,要求在任意一行,任意一列及任意一条对角线上都不能出现两个棋子。
本设计所涉及到的程序设计语言是VC++,采用的是递归和回溯的方法。首先在棋盘上找到一个位置,放置其中的一个皇后,然后对该皇后进行检查,查看她是否与棋盘同一行、同一列或同一斜线上已存在的皇后发生冲突。如果该皇后与棋盘上已经存在的皇后不发生冲突,则该皇后就摆放在此位置,继续试探下一个皇后的合适的位置;如果该皇后与棋盘上已经存在的皇后反生冲突,则该皇后就不能放在此位置,继续试探此皇后的下一个位置。直到将八个皇后都放到棋盘上,则问题解决。通过以上的方法对本课设题目进行设计与调试最后成功的输出了八皇后所有的92中合理布局,完成了设计题目的要求。
关 键 词:递归算法,八皇后,回溯法,VC++
-Abstract
The design of the content is in a line of eight international board, placed on any requirement, eight queen, any column and any diagonals cannot appear on two pieces.
This design involves the programming language is used, vc++ is recursive and back. First find a position on board, and placed in one of the queen, then the queen to inspect, check whether she and board with the same column or the same line, the queen of the existing cross-court conflict. If the queen and board existing queen not conflict, the queen will put in this position, continue to test a queen s place, If the queen on board with the queen the already existing conflict, the queen was born in this position, can continue to test the queen s next position. Until eight queen on board, problem solving. Through the above method for this class set subject designing and debugging of the output of the 92 8queens all reasonable layout, completed the design set the topic request.
Keywords: Recursive algorithm,Eight
(系统自动生成,下载前可以参看下载内容)
下载文件列表
八皇后/八皇后.cpp
八皇后/八皇后.dsp
八皇后/八皇后.clw
八皇后/ReadMe.txt
八皇后/八皇后.h
八皇后/MainFrm.h
八皇后/StdAfx.h
八皇后/StdAfx.cpp
八皇后/Resource.h
八皇后/八皇后.aps
八皇后/八皇后Doc.h
八皇后/八皇后Doc.cpp
八皇后/八皇后.rc
八皇后/res/八皇后.rc2
八皇后/res/八皇后Doc.ico
八皇后/res/八皇后.ico
八皇后/res/bitmap1.bmp
八皇后/res/bitmap2.bmp
八皇后/八皇后.dsw
八皇后/八皇后.ncb
八皇后/Debug/八皇后.res
八皇后/Debug/vc60.idb
八皇后/Debug/八皇后.pch
八皇后/Debug/vc60.pdb
八皇后/Debug/StdAfx.obj
八皇后/Debug/八皇后Doc.obj
八皇后/Debug/八皇后.pdb
八皇后/Debug/八皇后.exe
八皇后/Debug/八皇后.obj
八皇后/Debug/八皇后View.obj
八皇后/Debug/八皇后.ilk
八皇后/Debug/MainFrm.obj
八皇后/八皇后.plg
八皇后/八皇后View.h
八皇后/八皇后View.cpp
八皇后/MainFrm.cpp
八皇后/八皇后.opt
八皇后/res
八皇后/Debug
八皇后
八皇后/八皇后.dsp
八皇后/八皇后.clw
八皇后/ReadMe.txt
八皇后/八皇后.h
八皇后/MainFrm.h
八皇后/StdAfx.h
八皇后/StdAfx.cpp
八皇后/Resource.h
八皇后/八皇后.aps
八皇后/八皇后Doc.h
八皇后/八皇后Doc.cpp
八皇后/八皇后.rc
八皇后/res/八皇后.rc2
八皇后/res/八皇后Doc.ico
八皇后/res/八皇后.ico
八皇后/res/bitmap1.bmp
八皇后/res/bitmap2.bmp
八皇后/八皇后.dsw
八皇后/八皇后.ncb
八皇后/Debug/八皇后.res
八皇后/Debug/vc60.idb
八皇后/Debug/八皇后.pch
八皇后/Debug/vc60.pdb
八皇后/Debug/StdAfx.obj
八皇后/Debug/八皇后Doc.obj
八皇后/Debug/八皇后.pdb
八皇后/Debug/八皇后.exe
八皇后/Debug/八皇后.obj
八皇后/Debug/八皇后View.obj
八皇后/Debug/八皇后.ilk
八皇后/Debug/MainFrm.obj
八皇后/八皇后.plg
八皇后/八皇后View.h
八皇后/八皇后View.cpp
八皇后/MainFrm.cpp
八皇后/八皇后.opt
八皇后/res
八皇后/Debug
八皇后
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.