Last active
August 29, 2015 13:57
-
-
Save KT-Yeh/9484822 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void backtracking() | |
{ | |
if (填完所有空格) { | |
輸出解答; | |
return; | |
} | |
for (int i = 1; i <= 9; ++i) { | |
if (i符合規則) { | |
將i填入空格; | |
backtracking(); // 遞迴下去填下個空格 | |
將i從空格移除; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment