作者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