⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 08_05.cpp

📁 一些C++的课件和实验源代码
💻 CPP
字号:
// 08_05.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "list.h"
#include <conio.h>
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
	stack s;
	queue q;
	s.clear();
	q.clear();

	cout << "press any key to demostrate push stack and into queue..." << endl;
	getch();
	for(int i = 0; i < 10; i++){
		s.push(i);			// 压栈
		q.inqueue(i);		// 入队列
		cout << "stack: ";
		s.print();
		cout << "queue: ";
		q.print();
	}
	
	cout << "press any key to demostrate pop stack and out queue..." << endl;
	getch();
	while (!s.empty() && !q.empty()) {
		s.pop();			// 出栈
		q.outqueue();		// 出队列
		cout << "stack: ";
		s.print();
		cout << "queue: ";
		q.print();
	}

	cout << "press any key to exit...";
	getch();
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -