数独C ++代码 [英] sudoku c++ code
本文介绍了数独C ++代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好....告诉我如何在c ++中生成和解决数独问题.
hello....tell me how to generate & solve a sudoku in c++
推荐答案
您可以通过回溯来解决数独问题.
像->
1 0 2
0 3 9
4 0 0
现在编写一种回溯方法,该方法将o位置值填充到可以在该行和列中设置的某个可接受的值.通过此回溯,如果您可以到达最后一行和最后一列,那么您将找到解决方案:-D
如果您需要代码,可以给我发邮件.
You can solve sudoku problem by backtracking.
like ->
1 0 2
0 3 9
4 0 0
now write a backtracking method which fill the o position values by some acceptable value that can be set in that row & column. By this backtrack, if you can reach the last row & last column then you have get a solution :-D
If you need code, you can mail me.
看看建议的链接 ^ ].
现在试试.
这是询问者的期望:
1. 先尝试您要做什么!
2.制定看起来像问题/无法解决的问题.
尝试一下,告诉您是否遇到问题.
成员将很乐意为您提供帮助.
Have a look at the links suggeasted here[^].
Try now.
Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.
Try them and tell if you face issues.
Members will be more than happy to help like this.
您好,
以下文章介绍了您要实现的目标:
http://www.codeproject.com/KB/miscctrl/XSudokuWnd.asp [ ^ ]
Hi,
the following article explains what you try to achieve:
http://www.codeproject.com/KB/miscctrl/XSudokuWnd.asp[^]
这篇关于数独C ++代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文