作者ric2k1 (Ric)
看板EE_DSnP
标题[情报] 作业 8 的输入
时间Tue Dec 18 21:02:18 2007
Please also refer to post #763
有同学在问 input array 与 graph 的 number of nodes 要如何输入,
Like I said in the homework description,
I tried to simplify the I/O of this homework.
You can do something like:
// in main.cpp
#define SIZE 8 // change SIZE to test other input array
static int adjMat[SIZE][SIZE] = { // change this array for other graphs
{ 0, 0, 1, 0, 1, 0, 0, 1 },
{ 0, 0, 0, 0, 0, 0, 1, 0 },
{ 0, 0, 0, 1, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 1, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 0, 0, 1, 0 }
};
int main()
{
Graph gg(SIZE);
gg.readGraph();
...
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.134.219