首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的运行结果为( )。 #include void print(double a) { cout
下列程序的运行结果为( )。 #include void print(double a) { cout
admin
2021-02-22
19
问题
下列程序的运行结果为( )。
#include
void print(double a)
{
cout<<++a:
}
void print(int a,int b)
{
cout<
}
void main()
{
print(1.2);
eout<<"";
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://jikaoti.com/ti/4Ml0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
虚函数支持多态调用,一个基类的指针可以指向派生类的对象,而且通过这样的指针调用虚函数时,被调用的是指针所指的实际对象的虚函数。而非虚函数不支持多态调用。有如下程序; #include <iostream> using namespace std
关于函数重载,下列叙述中错误的是
C++中的模板包括
如果派生类以protected方式继承基类,则原基类的protected成员和public成员在派生类中的访问属性分别是
下列关于模板形参的描述中,错误的是
使用VC6打开考生文件夹下的源程序文件modi2.cpp。阅读下列函数说明和代码,完成空出部分程序。函数fun(hatN[4])的功能是用4个数字,组成互不相同且无重复数字的三位数,并将满足所有条件的数字输出到屏幕,并且每输出一个三位数字就换一行。
使用VC6打开考生文件夹下的源程序文件modi3.cpp。其中定义的类并不完整,按要求完成列操作,将类的定义补充完整,实现以下功能:(1)完成CBook类构造函数,对整型变量ID和作者Author进行赋值,请在注释//********1*****
有如下类定义:ciassA{char*a;public:A():a(0){}A(char*aa){//把aa所指字符串拷贝到a所指向的存储空间a=_____;strcpy(a,aa);
一个工作人员可使用多台计算机,而一台计算机被多个人使用,则实体工作人员与实体计算机之间的联系是
设有一个栈与一个队列的初始状态均为空。现有一个序列A,B,C,D,E,F,G,H。先分别将序列中的前4个元素依次入栈,后4个元素依次入队;然后分别将栈中的元素依次退栈,再将队列中的元素依次退队。最后得到的序列为
随机试题
女性,60岁,因消瘦、腹胀、纳差5年入院,病前曾有慢性肝病史,查:皮肤、巩膜黄染,腹部膨隆,移动性浊音阳性,脾肋下可触及。病人突然呕吐出暗红色血块约1000ml,急诊胃镜示“食管静脉曲张破裂出血”,护士应估计病人目前最有可能先出现()
关于呼吸活瓣,下列说法错误的是
婴儿腹泻经输液脱水纠正,出现精神萎靡、腹胀、心音低钝,首先应考虑为
A.稀硝酸B.稀盐酸C.硝酸D.盐酸E.醋酸盐缓冲液铁盐检查法中检查杂质所用的酸是
下述关于民用建筑项目中对公共服务设施用房布局的说法中,错误的是:[2012-31]
坚持以人为本,以人与自然的和谐为主线,以经济发展为核心,以提高人民生活质量为根本出发点,以科技和体制创新为突破口,坚持经济社会发展与人口、资源和生态环境相协调。这是我国21世纪初可持续发展的()。
财政收入分配职能的目标是()。
下列收入属于企业所得税应税收入的有()。
正方:论据:反方
CAFTA
最新回复
(
0
)