i will be the man:运算结果(用数组栈)
来源:百度文库 编辑:高校问答 时间:2024/05/12 01:21:39
很重要!很急!谢谢各位!baituo !
#include<iostream.h>
int base[100];
int size=0;
void push(int a)//入栈
{
base[size++]=a;
}
int pop()//出栈
{
return base[--size];
}
int main()
{
push(3);
push(4);
cout<<pop()<<endl;
cout<<pop()<<endl;
system("pause");
}