10.31更新 #1

Merged
psoyatper merged 1 commits from ver2.0 into main 1 year ago

@ -126,16 +126,6 @@ bool complement(int board[9][9], int row, int col) {
} }
void printSudokuSolution(int matrix[9][9]) {
printf("The solution of Sudoku matrix:\n");
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
printf("%d ", matrix[i][j]);
}
printf("\n");
}
}
void output(int board[9][9]){ void output(int board[9][9]){
int i; int i;
@ -159,7 +149,8 @@ int main() {
output(board); output(board);
if (check(board)) { if (check(board)) {
if (complement(board, 0, 0)) { if (complement(board, 0, 0)) {
printSudokuSolution(board); printf("The solution of Sudoku matrix:\n");
output(board);
} else { } else {
printf("No solution!\n"); printf("No solution!\n");
} }

Loading…
Cancel
Save