큐2 C++ - Stack Queue 참 속상한 일이 많네요.. 복잡한 일들이 큐와 스택처럼 차곡차곡 정리되고 빠져나갔으면 좋겠어요 #include using namespace std; #define QStackLimit 5 int queueStack[QStackLimit]={0}; int top=0; bool pop();// 현재 상태를 하나씩 보여줌 bool s_push(int);// 스택 bool q_push(int);// 큐 int main(void) { s_push(610);s_push(620);s_push(630); s_push(650);s_push(660);s_push(640); pop();pop();pop();pop();pop();pop(); q_push(10);q_push(20);q_push(30);q_push(40); q_.. 2010. 12. 28. C# 컬렉션기본 스택(Stack), 큐(Queue) using System; using System.Collections; ------------- 스택 --------------- public static void Main() { // 스택 객체 생성 Stack myStack = new Stack(); //스택에 값 입력하기 myStack.Push(100); myStack.Push(200); myStack.Push(300); myStack.Push(400); myStack.Push(500); Console.WriteLine("마지막 스택크기:{0}",myStack.Count); int stackCount = myStack.Count; // 스택에서 값을 인출하기; for(int i=0;i 2010. 5. 3. 이전 1 다음