C++ stack 容器

C++ stack 容器

cpp 复制代码
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<stack>
using namespace std;

void test01()
{
	stack<int>s;

	s.push(10);
	s.push(20);
	s.push(30);
	s.push(40);

	while (!s.empty())
	{
		cout << "栈顶元素->" << s.top() << endl;
		s.pop();
	}
}

int main()
{

	test01();

	return 0;
}
相关推荐
lclin_20203 小时前
VS2010兼容|C++系统全能监控工具(彩色界面+日志带单位+完整版)
c++·windows·系统监控·vs2010·编程实战
以神为界3 小时前
Python入门实操:基础语法+爬虫入门+模块使用全指南
开发语言·网络·爬虫·python·安全·web
逻辑驱动的ken4 小时前
Java高频面试题:03
java·开发语言·面试·求职招聘·春招
噜噜大王_4 小时前
深入理解 C 语言内存操作函数:memcpy、memmove、memset、memcmp
c语言·开发语言
广师大-Wzx5 小时前
一篇文章看懂MySQL数据库(下)
java·开发语言·数据结构·数据库·windows·python·mysql
野生技术架构师5 小时前
Java NIO到底是个什么东西?
java·开发语言·nio
lolo大魔王5 小时前
Go语言的异常处理
开发语言·后端·golang
paeamecium5 小时前
【PAT甲级真题】- Cars on Campus (30)
数据结构·c++·算法·pat考试·pat
UrSpecial6 小时前
从零实现C++轻量线程池
c++·线程池
chh5636 小时前
C++--模版初阶
c语言·开发语言·c++·学习·算法