// mymain9.cpp -- CopyLeft by tsaiwn@csie.nctu.edu.tw // g++ mymain9.cpp ; ./a.out #include "mystk9.h" // mystk9.h 是用 Inheritance 方式把 vector "擴充" 成 stack //注意以下是 1999之後的 C++ 新寫法, 舊法使用 #include using namespace std; int main( ){ MyStack x; // 注意這! x.push(880); x.push(770); x.push(53); while(!x.empty()){ cout << x.top(); x.pop(); } cout << endl; }