백준 10845

    [백준 10845번-C++] 큐

    http://acmicpc.net/problem/10845 {코드} #include #include #include using namespace std; int main() { queue q; string ip; int tmp, n; scanf("%d", &n); while (n--) { cin >> ip; if (ip == "pop") { if (!q.empty()) { printf("%d\n", q.front()); q.pop(); } else { printf("-1\n"); } } else if (ip == "size") { printf("%d\n", q.size()); } else if (ip == "empty") { if (!q.empty()) { printf("0\n"); } else { pr..