进制转换#includestdio.h#define Max 50typedef struct{ i

发布时间:2021-02-22 04:42:39

进制转换#includestdio.h#define Max 50typedef struct{ int elem[Max]; int top;}Sqstack;void initstack(Sqstack*p){ (*p).top=-1;}int empty(Sqstack s){ if(s.top==-1) return 1; else ruturn 0;}void push(Sqst

网友回答

void push(Sqstack*p,int x)
{if((++p->top)==50)
{printf(栈已满.);
}else{p->elem[p->top]=x;
}}int pop(Sqstack*p)
{int x;x=p->elem[p->top];p->top--;
return x;
}
以上问题属网友观点,不代表本站立场,仅供参考!