Write a program to print all the ways to place queens on an chessboard so that no queen threatens another queen.
Input consists of a natural number .
Print all the ways to put
queens on an
chessboard so that no queen threatens another queen. The queens must be
marked with a ‘Q’, and the empty positions with a dot.
Print an empty line after each board.
You can print the solutions to this exercise in any order.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T10:19:44.033Z
© Jutge.org, 2006–2026.
https://jutge.org