当前位置: 技术问答>java相关
8皇后的java实现。
来源: 互联网 发布时间:2015-01-19
本文导语: 各位高手: 请给出例程,马上给分。 | /** 八皇后问题例 */ import java.io.*; public class Class1 { public static void main (String[] args) { // TODO: Add initialization code here System.o...
各位高手:
请给出例程,马上给分。
请给出例程,马上给分。
|
/** 八皇后问题例
*/
import java.io.*;
public class Class1
{
public static void main (String[] args)
{
// TODO: Add initialization code here
System.out.println("Eight Queen Question");
System.out.println("Author :Xiaozhuang");
try{
System.in.read();
}catch(IOException ioe){
}
queen instance1 = new queen();
instance1.main();
try{
System.in.read();
}catch(IOException ioe){
}
System.out.println("Another instance ");
queen1 instance2 = new queen1();
instance2.main();
try{
System.in.read();
}catch(IOException ioe){
}
}
}
class queen
{
int a[][] = new int[8][8];
int ff(int m,int n,int k)
{
int i,j;
for (i=m,j=n; (i>=0)&&(j>=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i
*/
import java.io.*;
public class Class1
{
public static void main (String[] args)
{
// TODO: Add initialization code here
System.out.println("Eight Queen Question");
System.out.println("Author :Xiaozhuang");
try{
System.in.read();
}catch(IOException ioe){
}
queen instance1 = new queen();
instance1.main();
try{
System.in.read();
}catch(IOException ioe){
}
System.out.println("Another instance ");
queen1 instance2 = new queen1();
instance2.main();
try{
System.in.read();
}catch(IOException ioe){
}
}
}
class queen
{
int a[][] = new int[8][8];
int ff(int m,int n,int k)
{
int i,j;
for (i=m,j=n; (i>=0)&&(j>=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i