Skip to content

About

C语言实现的解数独

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

数独求解

数独应该都玩过,本程序利用递归和穷举法求解数独。

输入

逐行输入 0表示要填数,空格分隔每个输入,回车输入下一行
例如:

line 1: 5 0 0 0 7 0 0 0 9
line 2: 0 6 0 0 0 3 8 0 0
line 3: 0 0 9 0 2 0 6 0 4
line 4: 0 0 0 8 0 5 0 6 0
line 5: 1 5 8 6 0 0 0 0 0
line 6: 9 0 0 0 0 7 1 8 0
line 7: 0 0 2 7 0 0 0 0 8
line 8: 3 4 0 0 8 0 2 0 0
line 9: 0 1 0 0 0 9 0 4 3

输出

直接打印出结果:

5 8 1 4 7 6 3 2 9
2 6 4 9 5 3 8 7 1
7 3 9 1 2 8 6 5 4
4 7 3 8 1 5 9 6 2
1 5 8 6 9 2 4 3 7
9 2 6 3 4 7 1 8 5
6 9 2 7 3 4 5 1 8
3 4 7 5 8 1 2 9 6
8 1 5 2 6 9 7 4 3

问题

  1. 输入时用空格隔开每个数字,且只能有一个空格
  2. 我还没发现但应该还有很多

About

C语言实现的解数独

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages