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

📄 p168.cpp

📁 代码中包含了部分作者侯捷的<<STL源码剖析>>一书中的程序实例,有助于理解及应用STL,来进行方便高效的编程
💻 CPP
字号:
#include <stack>
#include <list>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	stack< int,list<int> > istack;
	istack.push(1);
	istack.push(3);
	istack.push(5);
	istack.push(7);

	cout<<"size="<<istack.size()<<endl;
	cout<<"top="<<istack.top()<<endl;

	istack.pop();
	cout<<istack.top()<<endl;
	istack.pop();
	cout<<istack.top()<<endl;
	istack.pop();
	cout<<istack.top()<<endl;
	cout<<"size="<<istack.size()<<endl;
	cout<<"top="<<istack.top()<<endl;

	return 0;
}

⌨️ 快捷键说明

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