#include <stdio.h>
#include <conio.h>
struct dstack
{char el;
dstack *next;};
void instack (char x, dstack **S)
{
dstack *r;
r = new dstack;
r->el = x;
r->next=*S;
*S=r;
}
int pust (dstack *S)
{
if (S==NULL) return 1;
return 0;
}
int outstack(char *x, dstack **S)
{
dstack *r;
int t;
t=pust (*S);
if (t==0)
{r=*S; *x=r->el;
*S=r->next;
delete r;
return 1;
}
return 0;
}
void newstack (dstack **S)
{
*S=NULL;
}
/*void prosmotr (dstack **S)
{
dstack *r;
newstack (&r);
while (pust (*S)!=1)
{int q;
int x;
q=outstack (&x, S);
printf ("%d ", x);
instack (x, &r);
}
while (pust (r)!=1)
{int q;
int x;
q=outstack (&x, &r);
instack (x, S);
}
}*/