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;
}
相关推荐
liulilittle1 天前
IP校验和算法:从网络协议到SIMD深度优化
网络·c++·网络协议·tcp/ip·算法·ip·通信
眠りたいです1 天前
基于脚手架微服务的视频点播系统-播放控制部分
c++·qt·ui·微服务·云原生·架构·播放器
耶啵奶膘1 天前
uni-app头像叠加显示
开发语言·javascript·uni-app
看海天一色听风起雨落1 天前
Python学习之装饰器
开发语言·python·学习
Want5951 天前
C/C++圣诞树①
c语言·开发语言·c++
老赵的博客1 天前
c++ 杂记
开发语言·c++
jimmy.hua1 天前
[C++刷怪笼]:set/map--优质且易操作的容器
开发语言·c++
tan180°1 天前
Boost搜索引擎 网络库与前端(4)
linux·网络·c++·搜索引擎
bkspiderx1 天前
C++经典的数据结构与算法之经典算法思想:贪心算法(Greedy)
数据结构·c++·算法·贪心算法
w2sfot1 天前
Passing Arguments as an Object in JavaScript
开发语言·javascript·ecmascript