#include <iostream.h>
#include <stdlib.h>
#include "MaxST.h"
#include "GraphOpr.h"
void main()
{
Graph* G;
FILE *fp;
char filename[255];
cout << "Filename:" << endl;
cin >> filename;
if ((fp = fopen(filename, "rt")) == NULL)
{
cout << "Unable to open file |" << filename << "|" << endl;
cout << "To know file format, View sample.gph" << endl;
exit(-1);
}
G = readGraph(fp);
if (G == NULL)
{
cout << "Unable to create graph" << endl;
cout << "To know file format, View sample.gph" << endl;
exit(-1);
}
printGraph(G);
int i;
i = 0;
Graph* max;
max = new Graph(G->n());
printGraph(max);
MaxST(G, i, max);
printGraph(max);
}
评论0