#include<iostream>
using namespace std;
#define Maxsize 100
class Qune
{
public:
int data[Maxsize];
int front;
int rear;
};
void Qinsert(Qune&A,int x); //入队
int Qdelete(Qune&A); //出队
int main()
{
Qune A;
A.front = A.rear = -1; //初始化空队列
}
void Qinsert(Qune&A,int x)
{
if ((A.rear + 1) % Maxsize == A.front){ //先判断队列时候满,队列存储的最大元素个数为Maxsize-1
cout << "队列已满";
return ;
}
A.rear = (A.rear + 1) % Maxsize; //循环队列,插入数在队尾
A.data[A.rear] == x;
}
int Qdelete(Qune&A)
{
if (A.rear== A.front){
cout << "队列已空";
return 0;
}
A.front = (A.front + 1) % Maxsize; //出队的在队前
return A.data[A.front];
}