This question came from the homework4 in the DS class.
Here I met two problems, one is how to show the solutions right; while another one is how to make the program recognize the integer from the bash.
Below is my final code:
The N-queens problem is the problem of positioning N Queens on an N x N chess board such that no queen attacks another (i.e. they do not share the same row, column, or diagonal).
Your task is to write a program that accept 1 argument (i.e. N) from the command line and print all solutions. The argument stands for N, where we have 4 <= N <= 10.
Your program should behave just like the sample:
Your should use recursive function in your program.
You should turn in all files via turnin command like: