i am trying to compile it (ms visual c++) but it is not compiling, i guess there is some errors but visual c++ is only saying fatal error which i have no idea what it is.Any idea?
#include "stdafx.h"
#include <iostream>
using namespace std;
int nbs=0;
void Queens(int nn, int row[], int k=0)
{ if(k==nn)
{ cout<<endl<<"Solution "<<(++nbs)<<":"<<endl;
for(int i=0; i<nn; i++)
{ for(int j=0; j<nn;j++)
{ if(row[i]==j) cout<<("Q "); else cout<<(". ");
} cout<<endl;} cout<<endl;}
else
{ for(int i=0; i<nn; i++)
{ row[k]=i;
for(int j=0; j<k;j++)
{ if((row[j]==row[k])||((row[j]-row[k])==(k-j))
||((row[k]-row[j])==(k-j))) goto fails;
} Queens(nn, row, k+1); fails:;}}
}
int qu_main(int argc, char *argv[])
{ const int nn = 8;
int *row = new int[nn];
Queens(nn, row);
return 0;
}