//testmyq2.cpp -- copyLeft by tsaiwn@csie.nctu.edu.tw // 以下的 #ifndef 是用來 check 是否為 GNU 的 g++ ? // 若不是則使用舊式的寫法! 例如 Turbo C++ 3.0 只認識舊式的寫法! #ifndef __GNUG__ #include #else #include using namespace std; #endif #include "myque2.h" ////// ////// ////// ////// ////// ////// int main( ) { MyQueue xo; xo.enque(53); xo.push(770); xo.push(880); while(!xo.empty( ) ) { cout << xo.top( ) << " "; xo.pop( ); } cout << endl; // new line return 0; }