编辑代码

#include <iostream>
using namespace std;
#define MAXSIZE 3
typedef struct{
    int *base;
    int front;
    int rear;
}queue;
bool dequeue(queue &q,int e){
    if(q.front == q.rear)
        return false;
}
bool enqueue(queue &q,int e){
    if((q.rear+1)%MAXSIZE == q.front){
        cout<<"0";
        return false;
    }
    q.front = (q.front+MAXSIZE-1)%MAXSIZE;
    q.base[q.front] = e;
    cout<<"1";
    return true;
}
int main() {
    queue q;
    q.base=new int[MAXSIZE];
    q.front = q.rear = 0;
    enqueue(q,0);
    enqueue(q,1);
    enqueue(q,3);
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
	cout << "Hello world!    - cpp.jsrun.net." << endl;
	return 0;
}