//判斷輸入括號組中左右括號的數量是否匹配
bool Match(char exp[],int n){
int i=0;char e;
bool match=true;
LiStack *st;
initStack(st);
while(i<n&&match){
if(exp[i]=='('){
Push(st,exp[i]);
}
else if(exp[i]==')'){
if(GetTop(st,e)==true){
if(e!='('){
match=false;
}
else{
Pop(st,e);
}
}
else{
match=false;
}
}
i++;
}
if(!StackEmpty(st)){
match=false;
}
return match;
}