求用C语言解一个简单sudoku数独的程序

2024-11-22 07:07:18
推荐回答(1个)
回答1:

void readGame (sudukoGrid game) {
cell currentCell = 0;
int inChar = getchar();
while (inChar != EOF) {
if (
((inChar >= MIN_VALUE) && (inChar <= MAX_VALUE)) ||
(inChar == EMPTY_VALUE)
) {
assert (currentCell <= MAX_CELL);
game [currentCell] = inChar;
currentCell++;
}
inChar = getchar();
}
assert (currentCell == (MAX_CELL+1));
}
第一个readgame,谁会别的?