首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n)
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n)
admin
2017-10-17
18
问题
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n){} int getAmount()const{return amount;} Amount&operator9=(Amount a){ amount+=a. amount; return______; } }; int main(){ Amount x(3),y(7); x+=y, cout<<x. getAmount()<<endl; return 0; }已知程序的运行结果是10,则下划线处缺失的表达式是
选项
A、* this
B、this
C、&amount
D、amount
答案
A
解析
转载请注明原文地址:https://kaotiyun.com/show/rPAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列叙述中错误的是
有以下程序段:#include<iostream.h>#defineMIN(x,y)(x)<(y)?(x):(y)voidmain(){inti,j,K;i=10;j=15;k
在C++语言中每个类都有一个______指针,该指针指向正在调用成员函数的对象。
C++语言是以()语言为基础逐渐发展演变而成的一种程序设计语言。
在程序设计阶段应该采取________和逐步求精的方法,把一个模块的功能逐步分解,细化为一系列具体的步骤,进而用某种程序设计语言写成程序。
()是一个在基类中说明的虚函数,它在该基类中没有定义,但要求任何派生类都必须定义自己的版本。
以下有关析构函数的叙述不正确的是
以下选项中合法的用户标识符是
下列程序将x、y和z按从小到大的顺序排列,请将下面的函数模板补充完整。template<classT>voidfun(______){Ta;if(x>y)
随机试题
隋唐时期孙思邈编写的医学著作是()
患者因不洁饮食后呕吐、腹泻伴少尿2天,不可能出现的尿液改变是()
该患者的中医诊断是:该病的证候分型是:
患儿女,6岁,咳嗽近2个月,咳声低微,痰稀白易咳出,汗多,不喜活动。查体:面色光白,瘦弱。舌淡嫩,脉细少力。此患儿应诊为
下列说法中不正确的为()。
案例 2016年3月28日13时12分,某煤业有限责任公司A所属矿井在基建施工中发生透水事故,造成38人死亡、115人受伤,直接经济损失4937.29万元。 该矿为基建矿井,设计生产能力600×104t/a。该矿采用平硐、斜井开拓方式,设计分2个水平开
以下不属于物理检验的是()。
AmericanwriterRobertFrostwasthePulitzerwinnerwith______times.
Theworld’senvironmentissurprisinglyhealthy.Discuss.Iftherewereanexaminationtopic,moststudentswouldtearitapart
ImprovingYourT.Q.(Test-TakingQuotient)TypesofTestsYouwillhaveonehourtocompletethistest.Allanswersmust
最新回复
(
0
)