#include <iostream>
#include <assert.h>
using namespace std;
//用类模板实现栈
template<typename T>
class Stack
{
private:
T *_data;
int _size;
int _top;
public:
void Push(T val); //入栈
bool Pop(); //出栈
T getTop(int *res); //取栈顶元素
bool isFull(); //判满
bool isEmpty(); //判空
void Expand() ; //扩容
void Show(); //打印
Stack(int resize = 2) //构造函数
{
cout << "Stack(int resize = 2)" << endl;
_data = new T[resize];
assert(_data != NULL);
_size = resize;
_top = 0;
}
//template<typename U>
//Stack<T>(const Stack<U>& src)
Stack(const Stack& stack) //拷贝构造函数
{
cout << "Stack(const Stack& stack)" << endl;
_data = new T[stack._size];
assert(_data != NULL);
for(int i = 0; i < stack._top; i+&#