填空题:下面是一个栈类的模板,其中push函数将元素i压入栈顶,pop函数弹出栈顶元素。栈初始为空,top值为0,栈顶元素在st

  • 题目分类:C++
  • 题目类型:填空题
  • 号外号外:关注公众号送1000体验阅读点!
题目内容:
下面是一个栈类的模板,其中push函数将元素i压入栈顶,pop函数弹出栈顶元素。栈初始为空,top值为0,栈顶元素在stack[top-1]中,在下面横线处填上适当语句,完成栈类模板的定义。
template
classTstack
{
enum{size=1000};
Tstack[size];
inttop;
public:
Tstack():top(0){}
voidpush(constT&i){
if(top
stack[top++]=i;
}
Tpop(){
if(top==0)exit(1);//栈空时终止运行
return(15);
}
};
关注公众号,送1000阅读点
关注公众号,送1000阅读点
1:点击图片或者扫二维码进入公众号,关注公众号!
2:私信发送您在66题库注册的会员号!
3:在一个小时内,您将收到充值卡
4:到点卡充值输入充值卡内容即可!
5:多关注多得!免费的呦!只要本站不倒闭,永久有效!
参考答案:【答案仅供学习,请勿对照自行用药等】
答案解析:

Please do not hesitate to call me if I can be of further ass

Please do not hesitate to call me if I can be of further assistance.A.contact B.

查看答案

关于世界气温的分布情况,下列说法正确的是:

关于世界气温的分布情况,下列说法正确的是:A.纬度是决定气温分布的主要因素,所以无论是1月还是7月.气温都从高纬向低纬递减 B.在北半球大陆上,1月份等温线向北

查看答案

The word “affect” in Paragraph 6 could be best replaced by

The word “affect” in Paragraph 6 could be best replaced byA.“influence” B.“effec

查看答案

Flowers and Yeo have started a programme

Flowers and Yeo have started a programmeA.to find ways to prevent water pollutio

查看答案

What does the last sentence in the third paragraph imply?

What does the last sentence in the third paragraph imply?A.More stress should be

查看答案