grprintm.cpp
来自「经典c++程序的实现」· C++ 代码 · 共 19 行
CPP
19 行
#include <iostream.h>
#include <stdio.h>
#include "..\include\grmat.h"
void Gprint(Graph& G) {
int i, j;
cout << "Number of vertices is " << G.n() << "\n";
cout << "Number of edges is " << G.e() << "\n";
cout << "Matrix is:\n";
for (i=0; i<G.n(); i++) {
for(j=0; j<G.n(); j++)
cout << G.matrix[i*G.n() + j] << " ";
cout << "\n";
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?