首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #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
2012-01-20
26
问题
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n){ } int getAmount( )const{return amount;} Amount&operator+=(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/ntVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有定义intx,y;并已正确给变量赋值,则以下选项中与表达式(x—y)?(x++):(y++)中的条件表达式(x—y)等价的是()。
以下程序的输出结果是()。#include<stdio.h>main(){inta=1,b=3;if((++a<0)&&!(b-<=0))printf("%d,%d\In",a,b);elseprintf("%d,%d\n",b,a
以下叙述中正确的是
有以下程序#include<stdio.h>doublefun(doublea){doublex;x=a-(int)a;returnx;}main(){doublea=3.1415;pr
使用VC++2010打开考生文件夹下blank1中的解决方案。此解决方案的项目中包含一个源程序文件blank1.c。在此程序中,函数fun的功能是:判断形参s所指字符串是否是”回文”(Palindrome),若是,函数返回值为1;不是,函数返回值为0。”回
以下不合法的用户标识符是()。
请编写函数fun,该函数的功能是:统计各年龄段的人数。N个年龄通过调用随机函数获得,并放入主函数的age数组中。要求函数把0~9岁年龄段的人数放在a[0]中,把10~19岁年龄段的人数放在d[1]中,把20~29岁年龄段的人数放在a[2]中,依此类推,把1
以下选项中不合法的标识符是()。
若以“a+”方式打开一个已存在的文件,以下叙述正确的是()。
随机试题
智力的差异表现在团体与团体之间最为明显的是【】
县级以上人民政府统计机构在调查统计违法行为或者核查统计数据时,有权采取的措施有()。
风险价值VAR的估算方法包括以下哪些选项()。Ⅰ.参数法Ⅱ.蒙特卡洛模拟法Ⅲ.现金流折现法Ⅳ.历史模拟法
某企业债务的账面价值为3000万元,权益资本成本为10%,永续的税前利润为700万元,适用的所得税税率为25%。按照公司价值分析法,该企业的价值为()万元。
有限责任公司某股东欲转让出资,于2006年2月15日发出书面转让通知,股东张某2006年3月1日收到该转让通知,张某需要在()之前对该转让事项进行答复,否则视为同意转让。
旅游团在旅游期间遇到安全事故,导游员应首先()。
“峰三千”“水八百”、树木种属繁多是()的总特色。
旅客收益管理和货物收益管理的区别在于()。
对于一个信息系统,BSP方法的基本要求是,向企业所提供的信息应该是()。
数据独立性是数据库技术的重要特点之一,所谓数据独立性是指
最新回复
(
0
)