栈实现算数表达式求值,负数部分加个说明
答案:2 悬赏:0
解决时间 2021-01-24 02:17
- 提问者网友:遮云壑
- 2021-01-23 02:16
栈实现算数表达式求值,负数部分加个说明
最佳答案
- 二级知识专家网友:神也偏爱
- 2021-01-23 03:00
#include
#include
#include
#include
typedef struct node
{ char data;
struct node *next;
}snode,*slink;
int Emptystack(slink S)
{ if(S==NULL)return(1);
else return(0);
}
char Pop(slink* top)
{ char e;
slink p;
if(Emptystack(*top))
return(-1);
else
{ e=(*top)->data;
p=*top;
*top=(*top)->next;
free(p);
return(e);
}
#include
#include
#include
typedef struct node
{ char data;
struct node *next;
}snode,*slink;
int Emptystack(slink S)
{ if(S==NULL)return(1);
else return(0);
}
char Pop(slink* top)
{ char e;
slink p;
if(Emptystack(*top))
return(-1);
else
{ e=(*top)->data;
p=*top;
*top=(*top)->next;
free(p);
return(e);
}
全部回答
- 1楼网友:duile
- 2021-01-23 04:16
建议:利用字符型二维数组逐个分析
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯