ナンプレ (ナンバープレース、数独) の解答を求める C 言語によるプログラムの例。 Windows XP+MinGW (gcc version 4.5.2) で動作確認。 #include <stdio.h> #define ROWS 9 /* 盤面の行数 */ #define COLS 9 /* 盤面の列数 */ #define BROWS 3 /* ブロックの行数 */ #define BCOLS 3 /* ブロックの列数 */ #define CELLS ROWS*COLS /* 盤面のマスの数 */ #define NUMS 9 /* 数字の種類 (1~9) */ #define EMPTY 0 /* マスの空白は0で表す */ /* 盤面を表示する */ void display(const int board[]) { int i; for( i = 0; i < CELLS