#include
using namespace std;
Int N;
Int queen [1000];
Void Nqueen (int n)
{
int i;
If (n==n)
{
for(i=0; i
}
for(i=0; i
int j;
for(j=0; j
If (queen [j]==I | | abs (queen [j] - I)==abs (n - j))
{
break;
}
}
If (j==n)
{
Queen [n]=I;
Nqueen (n + 1);
}
}
}
Int main ()
{
Cin> N;
Nqueen (0);
return 0;
}
If (queen [j]==I | | abs (queen [j] - I)==abs (n - j)) look not to understand this line have great god to give me explain
This judgment is used to determine whether and have visit good empress see if conflict of