#include
#define max 100
typedef struct saqstack
{
int elem[max];
int top;
}saqstack;
int push(saqstack *s,int a)
{
if(s->top==max-1)
return 0;
else
{
s->top=s->top+1;
s->elem[s->top]=a;
return 1;}
}
int cs(saqstack *s)
{
s->top=-1;
}
int pop(saqstack *s,int *x)
{
if(s->top==-1)
return 0;
else
{
*x=s->elem[s->top];
s->top=s->top-1;
return 1;}
}
int print(saqstack *s)
{
printf("%d",s->elem[s->top]);
return 0;
}
int main()
{
saqstack *s;
int *x;
cs(s);
printf("pelase input the number;");
int a;
scanf("%d",&a);
push(s,a);
print(s);
push(s,1);
print(s);
pop(s,x);
print(s);
return 0;
}