//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 100
#define ERROR 0
#define OK 1
typedef int SElemType;
typedef int Status;

typedef int QElemType;
typedef struct
{
QElemType data[MAXSIZE];
int front;
int rear;
}SqQueue;
//初始化队列
Status InitQueue(SqQueue* s)
{
s->front = 0;
s->rear = 0;
return OK;
}
//获得队列长度
int QueueLength(SqQueue Q)
{
int num = (MAXSIZE - Q.front + Q.rear)%MAXSIZE;
}
//入队
Status EnQueue(SqQueue* s, QElemType e)
{
if (((s->rear + 1) % MAXSIZE) == ((s->rear) % MAXSIZE))
{
return ERROR;
}
s->data[s->rear] = e;
s->rear = (s->rear + 1) % MAXSIZE;
return OK;
}
//出栈
Status DeQueue(SqQueue* s, QElemType* e)
{
if (((s->rear) % MAXSIZE) == ((s->front) % MAXSIZE))
{
return ERROR;
}
*e = s->data[s->front];
s->front = (s->front + 1) % MAXSIZE;
return OK;
}