?? test.cpp
字號:
#include <iostream.h>
class stack
{
public:
stack();
bool push(int);
bool pop();
private:
int base;
int top;
int Array[4];
}
stack::stack()
{
base = 0;
top = 0;
}
bool stack::push(int x)
{
if(top == 3)
{
cout<<"堆棧已滿,因此不能入棧"<<endl;
return false;
}
else
{
Array[top] = x;
top++;
return true;
}
}
bool stack::pop()
{
if(top == 0 )
{
cout<<""<<endl;
return false;
}
else
{
top--;
return true;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -