首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的运行结果为( )。 #include void print(double a) { cout
下列程序的运行结果为( )。 #include void print(double a) { cout
admin
2020-10-21
15
问题
下列程序的运行结果为( )。
#include
void print(double a)
{
cout<<++a;
}
void print(int a,int b)
{
cout<
}
void main()
{
print(1.2);
cout<<" ";
print(3,4);
}
选项
A、1.2 34
B、2.2 34
C、1.2 43
D、2.2 43
答案
D
解析
本题考查的是对重载函数的掌握,因为++a是右结合的,所以a先自加1再输出,即为2.2,之后调用函数print(int a,int b)输出b和a,即43。
转载请注明原文地址:https://kaotiyun.com/show/m5yp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
耦合性和内聚性是对模块独立性度量的两个标准。下列叙述中正确的是()。
在面向对象方法中,实现信息隐蔽是依靠()。
已知函数f的原型是“voidf(int*x,int&y);”,变量v1、v2的定义是“intv1,v2;”,下列调用语句中,正确的是()。
下列叙述中正确的是()。
有如下程序:#include#includeusingstd::cout;classPoint{public:frienddoubledistance(constPoint&p
有如下程序:#includeusingnamespacestd;classA{public:A(){cout
有如下程序:#includeusingnamespacestd;intmain(){inti,s=0;for(i=1;s<20;i+=2)s+=i*i;cout<<i<<endl;
if语句的语法格式可描述为:格式1:if()或格式2:if()else关于上面的语法格式,下列表述中错误的是()。
算法的有穷性是指()。
在满足实体完整性约束的条件下()。
随机试题
急性尿路感染的治疗关键在于
甲是某搬运场司机,在搬运场驾车作业时违反操作规程,不慎将另一职工轧死。对甲的行为应当如何处理?()(2005/2/20)
We______soasnottowaketheroommates.
下列哪项属于湿淫证的致病特点
桩冠长度至少应为根长的A.1/3~1/2B.1/2~2/3C.2/3~3/4D.1/3E.1/2
患者男性,57岁,患痹证5年余,经久不愈,肢体关节疼痛,屈伸不利,关节肿大、僵硬、变形,甚则肌肉萎缩,筋脉拘急,肘膝不得伸,舌质暗红,脉细涩。瘀血征明显者,可加用
下列关于诉的分类的说法正确的是:()
中国人民银行可以建议国务院银行业监督管理机构对银行业金融机构进行检查监督,后应当在收到建议之日起()内予以回复。
某市水务公司和甲单位同在A行开户,本月甲单位向水务公司支付水费50万元,另甲单位由于资金困难,向A银行申请贷款100万元,期限为6个月,银行经审无误办理,后因种种原因甲单位该笔贷款不能按期归还,需要办理展期手续。根据以上资料,回答下列问题:该客户支付5
Thefollowingparagraphsaregiveninawrongorder.ForQuestions41-45,youarerequiredtoreorganizetheseparagraphsintoa
最新回复
(
0
)