⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tc1.cpp

📁 数据结构c++语言描述 Borland C++实现
💻 CPP
字号:



// compute transitive closure

#include<iostream.h>
#include "lg5.h"
#include "make2db.h"

void main(void)
{
   LinkedGraph G(0);
   int **TC;
   Make2DArray(TC,20,20);


   // try three graphs
   for (int j = 1; j <= 3; j++) {
      G.Input();
      cout << "The input graph is" << endl;
      G.Output();

      G.TransitiveClosure(TC);
      int n = G.Vertices();

      cout << "The transitive closure is" << endl;
      for (int j = 1; j <= n; j++) {
         for (int k = 1; k <= n; k++)
            cout << TC[j][k] << ' ';
         cout << endl;
         }

      }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -