30 lines
353 B
C
30 lines
353 B
C
|
|
#include <unistd.h>
|
|
#define SIZE 10
|
|
|
|
int backtrack(cols[SIZE], int col, int sols)
|
|
{
|
|
if (col >= SIZE)
|
|
return sols + 1;
|
|
}
|
|
|
|
int ft_ten_queens_puzzle()
|
|
{
|
|
int cols[SIZE];
|
|
int i;
|
|
|
|
i = 0;
|
|
while (i < SIZE)
|
|
cols[i] = -1;
|
|
|
|
return (backtrack(cols, 0, 0));
|
|
}
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
printf("%d\n", ft_ten_queens_puzzle());
|
|
}
|