摘要: 题目的本质就是叫你求图中连通分支的数目。 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 5 int dx[4] = {1,-1, 0, 0}; 6 int dy[4] = {0, 0,-1, 1}; 7 int map[101][101]; 8 int visit[101][101],num,col,row; 9 10 void DFS(int x,int y)//求出图中所有的连通分支简单DFS遍历11 {12 int i, j, x1, y1;13 if(visit[x][ 阅读全文
posted @ 2012-03-16 21:40 zhongya 阅读(155) 评论(0) 推荐(1) 编辑