初始化第四题
This commit is contained in:
@@ -5,5 +5,23 @@
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user