C++ 큐

1 개요[ | ]

C++ queue
C++ 큐
#include <iostream>
#include <queue>
using namespace std;

void show(queue<int> q) {
    queue<int> qq = q;
    while (!qq.empty()) {
        cout << qq.front() << ' ';
        qq.pop();
    }
    cout << '\n';
}

int main() {
    queue<int> q;
    q.push(3);
    q.push(1);
    q.push(4);
    q.push(8);
    
    show(q); // 3 1 4 8
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}