看板 EE_DSnP 關於我們 聯絡資訊
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