堆栈、队列、字符串匹配相关算法C+实现一、堆栈.cpp部分#include#includestack.husing namespace std;int main () int c; cout输入堆栈大小:c;astack STA1(c); int t; cout输入栈元素:endl;for(int i=0;it;STA1.push(t); int ch;cout1:弹栈endl;cout2:获取栈顶元素:endl;cout3:入栈元素:endl;cout4:输出栈中元素;endl;cout5:重设栈的大小:ch;while(ch!=-1)switch(ch)case 1:int re1; STA1.pop(re