叶染青和苏铁惜的结局:运算结果(用数组栈)
来源:百度文库 编辑:中科新闻网 时间:2024/05/04 07:17:38
很重要!很急!谢谢各位!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");
}