C++求解数独

时间:2015-08-05 12:48:43
【文件属性】:

文件名称:C++求解数独

文件大小:4KB

文件格式:ZIP

更新时间:2015-08-05 12:48:43

C++ 数独

#include "Sudoku.h" #include int main() { Sudoku::Grid grid; grid(0, 0) = 8; grid(1, 2) = 3; grid(1, 3) = 6; grid(2, 1) = 7; grid(2, 4) = 9; grid(2, 6) = 2; grid(3, 1) = 5; grid(3, 5) = 7; grid(4, 4) = 4; grid(4, 5) = 5; grid(4, 6) = 7; grid(5, 3) = 1; grid(5, 7) = 3; grid(6, 2) = 1; grid(6, 7) = 6; grid(6, 8) = 8; grid(7, 2) = 8; grid(7, 3) = 5; grid(7, 7) = 1; grid(8, 1) = 9; grid(8, 6) = 4; const std::vector &result;(Sudoku::answers(grid)); for (int i = 0; i < result.size(); ++i) { std::cout << result.at(i) << "\n"; } return 0; }


【文件预览】:
Sudoku.cpp
Sudoku.h
main.cpp

网友评论