N皇后问题(pascal)DFS ! 重在注释!!

[复制链接]
查看11 | 回复1 | 2012-5-29 21:33:02 | 显示全部楼层 |阅读模式
程序(PASCAL)const max=8;var i,j:integer;a:array[1..max] of 0..max; {放皇后数组}b:array[2..2*max] of boolean;{/对角线标志数组}c:array[-(max-1)..max-1] of boolean; {\对角线标志数组}col:array[1..max] of boolean; {列标志数组}total:integer;{统计总数}procedure output; {输出}var i:integer;begin
write('No.':4,'[',total+1:2,']'); ...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行