void main ()
{
initstack(s);
scanf(str);
for(i=0;sti[i];i++)
switch(str[i])
{
case‘(’:
case‘[’:
case‘{’:push(s,str[i]);break;
case‘)’:gettop(S,x);
if(x=‘(’)pop(S,y);else{printf(“ERROR”);exit(0);}
break;
case‘]’:gettop(S,x);
if(x=‘[’)pop(S,y);else{printf(“ERROR”);exit(0);}
break;
case‘}’:gettop(S,x);
if(x=‘{’)pop(S,y);else{printf(“ERROR”);exit(0);}
break;
}
if(stackempty(s))printf(“success”);
else printf(“Error”);
}