摘要: #include<stdio.h> int a[1005][1005],n,m,n_x,n_y,s_x,s_y,book[1005][1005],min=1005; void find(int x,int y,int step); void go(int x,int y); int main(){ 阅读全文
posted @ 2021-12-16 21:09 m2on 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 配合for循环和递归进行搜索 深度优先搜索侧重于将当下如何做,然后利用递归不断进行“当下”,直到基准情况返回。 下面代码 输入一个数字(1-9)输出 123...n的全排列 #include<stdio.h> void put(int n); int num,a[10],book[10],count 阅读全文
posted @ 2021-12-16 17:01 m2on 阅读(20) 评论(0) 推荐(0) 编辑