64,282
社区成员
发帖
与我相关
我的任务
分享
bool stack::push(const Item &item)
{
if(top < MAX)
{
items[top++] = item;
return true;
}
else
return false;
}
bool stack::pop(Item &item)
{
if(top > 0)
{
item = items[--top];
return true;
}
else
return false;
}