摘要: 参考代码:http://blog.csdn.net/cyberzhg/article/details/6691094http://blog.csdn.net/popopopolo/article/details/6451284http://hi.baidu.com/xfqanjlskyfnpyr/item/4b95d68f3d9841d7d1f8cd05 阅读全文
posted @ 2013-01-07 20:29 wonderlily 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <string.h> 3 #define MAXN 101 4 bool map[MAXN][MAXN]; 5 int n,m; 6 7 void floyd() 8 { 9 for(int k=1; k<=n; k++)10 for(int i=1; i<=n; i++)11 for(int j=1; j<=n; j++)12 map[i][j]=(map[i][j]||(map[i][k]&&map[k][j]));13 }14 15 int ... 阅读全文
posted @ 2013-01-07 19:57 wonderlily 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<fstream> 3 #include<cstring> 4 5 using namespace std; 6 #define MAXN 28 7 8 bool adj[MAXN][MAXN]; 9 int indegree[MAXN];10 char str[MAXN];11 int n, m;12 13 14 15 16 int topo_sort()17 {18 int i,j,k;19 int flag = true;20 memset(indegree,0,sizeof(indegre 阅读全文
posted @ 2013-01-07 19:53 wonderlily 阅读(177) 评论(0) 推荐(0) 编辑