定義 max為陣列元素的最大容量. 宣告陣列stack,元素個數為max. 宣告全域變數top為堆疊的頂端,初始值為-1. 宣告push函式,用來推入資料. 宣告pop函式,用來移出資料.
確定! 回上一頁