nohead_linstack.cpp

来自「不带头结点的链式堆栈类,1、 定义并实现不带头结点的链式堆栈类」· C++ 代码 · 共 29 行

CPP
29
字号
#include<iostream.h>
#include<stdlib.h>

const int MaxStackSize=100;
typedef int DataType;
#include"nohead_LinStack.h"

template <class T>
void Order(nohead_LinStack<T>&s)
{
	DataType test[]={1,3,5,7,9};
	int n=5;

	for(int i=0;i<n;i++)
		s.Push(test[i]);

	while(s.NotEmpty())
		cout<<s.Pop()<<" ";
}

void main(void)
{
	nohead_LinStack<int> s;
	Order(s);
	cout<<endl;
}


⌨️ 快捷键说明

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