28 lines
503 B
C++
28 lines
503 B
C++
//test3.cpp
|
|
#include<iostream>
|
|
#include"SeqQueue.h"
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
SeqQueue q;
|
|
initSeqQueue(q);
|
|
if (isEmpty(q)) {
|
|
//判断队空
|
|
cout << "此队伍为空" << endl;
|
|
}
|
|
|
|
for (int i = 1; i <= MAX_SIZE; i++) {
|
|
enQueue(q, i); //入队
|
|
}
|
|
if (isFull(q)) {
|
|
//判断队满
|
|
cout << "此队伍已满" << endl;
|
|
}
|
|
while (!isEmpty(q)) {
|
|
cout << deQueue(q) << " "; //出队
|
|
}
|
|
cout << endl;
|
|
return 0;
|
|
}
|