📄 test.cpp
字号:
#include "ALGraph.cpp"
main()
{ string ss[8]={"0","1","2","3","4","5","6","7"};
vector<string> vs(ss,ss+8);
ALGraph<string> G(vs);
Edge es[10]={{0,1,1},{0,7,1},
{1,2,1},
{2,3,1},
{3,4,1},{3,5,1},{3,6,1},
{4,5,1},
{5,6,1},{5,7,1}
};
vector<Edge> edges(es,es+10);
G.Append(edges);
G.Output();
vector<string> topo;
bool flag=G.TopoSort(topo);
for(int i=0; i<topo.size(); i++)
cout<<topo[i]<<" ";
cout<<endl;
if(flag) cout<<"无环"; else cout<<"有环";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -