八皇后问题---python
摘要:
#-*-coding:utf-8-*-count = 0locs = []def check_p(i,j): for x in range(len(locs)): if locs[x] == i: return False if abs(locs[x] - i) == abs(x - j): return False return Truedef main(j): global count,locs for i in range(8): if check_p(i,j) == True:... 阅读全文
posted @ 2013-11-28 12:34 lgy111 阅读(250) 评论(0) 推荐(0) 编辑