#define MAXITEM 200
typedef struct{
int item[MAXITEM];
int top;
}stack;
stack s1,s2;
void ClearStack(stack *s)
{
s->top=0;
}
int Empty(stack *s)
{
if(s->top==0)
return 1;
else return 0;
}
int Full(stack *s)
{
if(s->top>=MAXITEM-1)
return 1;
else return 0;
}
int Push_two(stack *s1,stack *s2,int t)
{
if(Full(s1)||Full(s2))
{
printf("overflow\n");
return 0;
}
else if(t/2 != 0)
{
s1->item[s1->top]=t;
s1->top++;
printf("Push into the s1\n");
return 1;
}
else if(t/2 == 0)
{
s2->item[s2->top]=t;
s2->top++;
printf("Push into the s2\n");
return 1;
}
}
int Pop_two(stack *s1,stack *s2)
{
if(Empty(s1)||Empty(s2))
{
printf("underflow\n");
return 0;
}
else if(s1->top--)
return s1->item[s1->top];
else if(s2->top--)
return s2->item[s2->top];
}
void main()
{
int i,n;
struct stack s1,s2;
char b[200];
gets(b);
n=strlen(b);
for(i=0;i
for(i=0;i
}