[([([(]]]))) 这个是判断不出来的
//存在的
MyStack<char> *pStack = new MyStack<char>(100);
//需要的
MyStack<char> *pNeedStack = new MyStack<char>(100);
char str[] = "[([([(]]])))";
// char str[] = "[()[()]]";
for(int i=0;i<strlen(str);i++){
char t = str[i];
if(t == '('){
pNeedStack->push(')');
}else if(t == '['){
pNeedStack->push(']');
}else{
pStack->push(t);
}
}
if(pNeedStack->stackLength() == pStack->stackLength()){
cout << "字符串匹配" << endl;
}else{
cout << "字符串不匹配" << endl;
}