using namespace std;
class Quene
{
private:
int * theArray;
int maxSize;
int currentSize;
int front;
int rear;
void increment(int &x){++x;}
public:
Quene(int capacity)
{
maxSize = capacity;
front = 0;
rear = -1;
currentSize = 0;
int n;
cin>>n;
int i = 0;
while(n != 0)
{
theArray[i] = n;
i++;rear++;currentSize++;
cin>>n;
}
}
bool isEmpty()
{
return currentSize == 0;
}
bool isFull()
{
return currentSize == maxSize;
}
void makeEmpty()
{
currentSize = 0;
front = 0;
rear = -1;
}
int getFront()
{
if(isEmpty())
{
cout<<"error!";return 0;
}
return theArray[front];
}
int DeQuene()
{
if(isEmpty())
{
cout<<"error!";return 0;
}
currentSize--;
int frontItem = theArray[front];
increment(front);
return frontItem;
}
void EnQuene(int & x)
{
increment(rear);
theArray[rear] = x;
currentSize++;
}
};