2008-05-15

八皇后问题

关键字: 八皇后问题
1.实现代码: package U4; public class 八皇后 { static boolean[][] hh=new boolean[8][8];//8*8棋盘 static int count=0;//已经放上的皇后数 static int num=0;//摆放方式的总数 public boolean tj1(int line){//条件一,判断此列是否有摆放皇后 for(int i=0;i<8;i++){ if(hh[i][line]==true){ return false; } } return tru ...
kuangbaoxu
搜索本博客
最近加入圈子
存档
最新评论