제목 그대로 스택과 큐를 사용하는 간단한 소스코드입니다.
#include#include #include using namespace std; int main() { cout << "-----------------Stack-----------------" << endl; cout << endl; stack st; st.push(1); st.push(2); st.push(3); int count = st.size(); for(int i=0; i < count; i++){ cout << st.top() << endl; st.pop(); } cout << endl; cout << endl; cout << "-----------------Queue-----------------" << endl; cout << endl; queue qu; qu.push(1); qu.push(2); qu.push(3); count = qu.size(); for(int i=0; i < count; i++){ cout << qu.front() << endl; qu.pop(); } return 0; }
'Windows Programming > Win32 API & MFC & C/C++' 카테고리의 다른 글
| [퍼옴] 폴더 및 파일 경로 조작에 필요한 API 정리. (0) | 2010/01/26 |
|---|---|
| [STL] Stack과 Queue 사용법 (0) | 2009/10/01 |
| Win32 API Start Source - 윈도우즈 프로그래밍 기본창 띄우는 Win32 API 소스 (0) | 2009/09/01 |
| 윈도우창과 콘솔창 2개 띄우기 (0) | 2009/06/02 |
| 윈도우즈의 최대 경로 길이(MAX_PATH)에 대해서... (0) | 2009/05/28 |
| 네트워크(NIC) 사용/사용해제 하기 (2) | 2009/02/08 |

댓글을 달아 주세요