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;
}
相关推荐
harder32113 分钟前
RMP模式的创新突破
开发语言·学习·ios·swift·策略模式
jinanwuhuaguo24 分钟前
OpenClaw工程解剖——RAG、向量织构与“记忆宫殿”的索引拓扑学(第十三篇)
android·开发语言·人工智能·kotlin·拓扑学·openclaw
Rust研习社26 分钟前
使用 Axum 构建高性能异步 Web 服务
开发语言·前端·网络·后端·http·rust
徐某人..1 小时前
基于i.MX6ULL平台的智能网关系统开发
arm开发·c++·单片机·qt·物联网·学习·arm
无敌秋2 小时前
# C++ 简单工厂模式实战指南
c++·简单工厂模式
淘矿人2 小时前
从0到1:用Claude启动你的第一个项目
开发语言·人工智能·git·python·github·php·pygame
cany10002 小时前
C++ -- 模板的声明和定义
开发语言·c++
澈2072 小时前
深耕进阶 Day1:C 与 C++ 核心差异 + C++ 入门基石
c语言·开发语言·c++
Felven2 小时前
C. Need More Arrays
c语言·开发语言