Олимпиадный тренинг

Задача 38602. simple queue


Задача

Темы: Очередь
Implement the "queue" data structure. Write a program that describes the queue and simulates the operation of the queue by implementing all the methods listed here. The program reads a sequence of commands and, depending on the command, performs one or another operation. After executing each command, the program should print one line. Possible commands for the program:

push n
Add the number n to the queue (the value of n is given after the command). The program should print ok.
pop
Remove the first element from the queue. The program should output its value.
front
The program should output the value of the first element without removing it from the queue.
size
The program should print the number of elements in the queue.
clear
The program should clear the queue and print ok.
exit
The program should print bye and exit.
It is guaranteed that the set of input commands satisfies the following requirements: the maximum number of elements in the queue at any time does not exceed 100, all pop and front commands are correct, that is, when they are executed, the queue contains at least one element.

 
Input
Queue management commands are entered, one per line

Imprint
It is required to display the log of work with the queue, one message per line
Examples
# Input Output
1 size
push 1

push 2

push 3

exit
0
ok
1
ok
2
ok
3
bye