https://www.acmicpc.net/problem/15828
- 큐와 관련 함수를 활용한다.
 - 양수일때 큐의 크기와 버퍼의 크기를 비교한다
 - 만약 큐의 크기가 작다면 push하고 그렇지 않다면 버린다.
 - 0일때는 pop, -1일 때는 반복문을 종료시킨다.
 - 큐가 비어있는지 확인하고 비어있지 않다면 pop을 해가면서 출력
 
#include <iostream>
#include <queue>
using namespace std;
int main(){
    int size;
    cin >> size;
    int num;
    queue<int> q;
    while(true)
    {
        cin >> num;
        if(num == -1)
            break;
        if(num > 0)
        {
            if(q.size() < size)
                q.push(num);
        }
        if(num == 0)
            q.pop();
    }
    if(q.empty())
        cout << "empty" << endl;
    else
        while(!q.empty())
        {
            cout << q.front() << ' ';
            q.pop();
        }
}