longest.cpp
来自「数据结构c++语言描述 Borland C++实现」· C++ 代码 · 共 35 行
CPP
35 行
#include <iostream.h>
#include "awd1.h"
void main(void)
{
AdjacencyWDigraph<int> G(0);
int L[101],
kay[101];
// try three graphs
for (int j = 1; j <= 3; j++) {
G.Input();
cout << "The input digraph is" << endl;
G.Output();
cout << "The length of the longest path is "
<< G.Longest(L,kay) << endl;
cout << "The L values are ";
for (int i = 1; i <= G.Vertices(); i++)
cout << L[i] << " ";
cout << endl;
cout << "The kay values are ";
for (int i = 1; i <= G.Vertices(); i++)
cout << kay[i] << " ";
cout << endl;
cout << "The longest path is ";
G.OutputLongest(L,kay);
cout << endl;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?