没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
typedef struct BiTree
{
char data;
struct BiTree *Lchild;
struct BiTree *Rchild;
}BiTree, *Binary_Tree;
#define MAXN 100
//定义栈,类型int
typedef struct node {
int data[MAXN];
int top;
}node, *pointer;
//入栈
int Push(node* ss, int* x)
{
if (ss->top<MAXN)
{
ss->top++;
ss->data[ss->top] = *x;
return 1;
}
else
#include<stdlib.h>
#include<iostream>
using namespace std;
typedef struct BiTree
{
char data;
struct BiTree *Lchild;
struct BiTree *Rchild;
}BiTree, *Binary_Tree;
#define MAXN 100
//定义栈,类型int
typedef struct node {
int data[MAXN];
int top;
}node, *pointer;
//入栈
int Push(node* ss, int* x)
{
if (ss->top<MAXN)
{
ss->top++;
ss->data[ss->top] = *x;
return 1;
}
else
{
cout << "error" << endl;
return 0;
}
}
//出栈
int Pop(node *ss, int *x)
{
if (ss->top == -1)
{
cout << "栈空" << endl;
return 0;
}
else
{
*x = ss->data[ss->top];
ss->top--;
return 1;
}
}
int eval(char op, int x, int y)
{
switch (op)
{
case '+':
return x + y;
case '-':
return x - y;
case '*':
cout << "error" << endl;
return 0;
}
}
//出栈
int Pop(node *ss, int *x)
{
if (ss->top == -1)
{
cout << "栈空" << endl;
return 0;
}
else
{
*x = ss->data[ss->top];
ss->top--;
return 1;
}
}
int eval(char op, int x, int y)
{
switch (op)
{
case '+':
return x + y;
case '-':
return x - y;
case '*':
剩余6页未读,继续阅读







资源评论

XS_
- 粉丝: 60
- 资源: 24

上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
已下载
下载帮助

看过该资源的人还看了
安全验证
文档复制为VIP权益,开通VIP直接复制
