stack1 stack stack 1.소스 #include #include using namespace std; // User defined stack that uses a queue class Stack { public: queueq; public: void push(int val); void pop(); int top(); bool empty(); }; // Push operation void Stack::push(int val) { // Get previous size of queue int s = q.size(); // Push current element q.push(val); // Pop (or Dequeue) all previous // elements and put them after current // elem.. 2016. 8. 3. 이전 1 다음