Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
史上最牛“八皇后”求解程序
deepin Talks
989
views ·
2
replies ·
To
floor
Go
xliang9550
deepin
2015-03-31 06:09
Author
源码来自IOCCC大赛官网(开放授权)1990年获奖项目。
源程序(附件)第一行的
#include
Copy the Code
是我自行添加的以保证通过编译,不知在当时是否多余。
使用GCC可以编译成功,会有1条警告信息。
输出说明:“#”=黑格;“空格”=白格;“Q”=皇后
程序运行开始时输入棋盘的大小,支持4~98……
1990.txt
Reply
Like 0
Favorite
View the author
All Replies
nbxwj
deepin
2015-04-01 15:35
#1
绝了,用geany编译通过。
Reply
Like 0
View the author
xliang9550
deepin
2015-04-01 19:34
#2
如果严格按照C99的规范,首先需要加上预处理。变量和函数的声明需要指定数据类型,不再默认为int。将程序前三行改为
#include
int v,i,j,k,l,s,a[99];
void main(void)
Copy the Code
这样编译就不会有警告信息了。原程序写于1990年,那时还没有C99,而C89都还没有完全普及。
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
the Network section no longer appears
Error during system installation
Deepin IDE?
Music player with sample rate and bit depth
Popular Events
More
源程序(附件)第一行的
使用GCC可以编译成功,会有1条警告信息。
输出说明:“#”=黑格;“空格”=白格;“Q”=皇后
程序运行开始时输入棋盘的大小,支持4~98……
1990.txt