欢迎来到天天文库
浏览记录
ID:37909364
大小:16.82 KB
页数:3页
时间:2019-06-02
《C++表达式括号匹配》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#includeusingnamespacestd;#includeclassSeqStack{public:SeqStack(){top=-1;}~SeqStack(){}voidPush(charx);charPop();private:intdata[20];inttop;};voidSeqStack::Push(charx)//P{top++;data[top]=x;}charSeqStack::Pop()//D{intt;t=top;top--;returndata[t
2、];}intmain(){SeqStackA;intn,i,count=0,k,t;charstr[50];while(cin>>str){k=0;t=0;n=strlen(str);for(i=0;i3、;}
3、;}
此文档下载收益归作者所有