grtestm.cpp
来自「数据结构与算法分析」· C++ 代码 · 共 33 行
CPP
33 行
#include <iostream.h>
#include <stdlib.h>
#include "book.h"
#include "grmat.h"
// Simple program to test graph construction:
// Version for Adjancency Matrix representation
main(int argc, char** argv) {
Graph* G;
FILE *fid;
if (argc != 2) {
cout << "Usage: grtestm <file>\n";
exit(-1);
}
if ((fid = fopen(argv[1], "rt")) == NULL) {
cout << "Unable to open file |" << argv[1] << "|\n";
exit(-1);
}
G = createGraph<Graphm>(fid);
if (G == NULL) {
cout << "Unable to create graph\n";
exit(-1);
}
Gprint(G);
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?