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;
}
相关推荐
朝朝辞暮i30 分钟前
C++ 第 23 课:class —— 开始真正进入面向对象
开发语言·c++·算法
小师兄吃牛肉1 小时前
C语言篇:宏
c语言·开发语言
郑同学的笔记2 小时前
【c++随笔28】strcmp 和 memcmp对比
开发语言·c++
随意起个昵称2 小时前
【背包dp】输出方案路径
c++·动态规划
言乐62 小时前
Python根据无法识别搜索词找出可能输入内容模型
开发语言·python·django·virtualenv·pygame
weixin_307779132 小时前
有限产能智能排产与动态重排智能体:从需求解构到技术实现
开发语言·人工智能·算法·架构
kakakahahahaha2 小时前
Windows C盘临时文件清理:%temp%、Windows Temp、Prefetch、Windows.old与hiberfil.sys处理指南
c语言·开发语言·windows
朝朝辞暮i3 小时前
C++ 第 27 课:智能指针 shared_ptr
开发语言·c++·算法
by209993 小时前
学会使用std::string类,并理解其内部是如何管理字符串的详细阐述(上)
c++·笔记·字符串·类和对象·string
沙漠之主3 小时前
C++编程教学设计资料:从入门到实战的完整课程方案
java·前端·c++