2012年3月15日

摘要: 拿C实现了一个8皇后,回溯的算法实现对单一解得获得。棋盘大小超过18个仍然有问题,改天在调试。去年代码写的太少了,生疏的真快。View Code 1 #include <stdio.h> 2 #include <math.h> 3 4 5 #define MAX_NUM (10) 6 7 int col[MAX_NUM] = {0}; 8 int status[MAX_NUM][MAX_NUM] = {0}; 9 10 void find(int col); 11 void initStatus(int col); 12 int findcol(int col); .. 阅读全文

posted @ 2012-03-15 23:21 Fredric 阅读(169) 评论(0) 推荐(0) 编辑


Copyright © 2024 Fredric
Powered by .NET 8.0 on Kubernetes