首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若下面程序运行时输出结果为: 1,A,10.1 2,B,3.5 请将程序补充完整。 #include using namespace std; intmain() { void test
若下面程序运行时输出结果为: 1,A,10.1 2,B,3.5 请将程序补充完整。 #include using namespace std; intmain() { void test
admin
2012-12-29
34
问题
若下面程序运行时输出结果为:
1,A,10.1
2,B,3.5
请将程序补充完整。
#include
using namespace std;
intmain()
{
void test(int,char,double__________);
test(1,‘A’,10.1);
test(2,‘B’);
return 0:
}
void test(int a,char b,double c)
{
cout<
}
选项
答案
=3.5
解析
本题考查了函数默认参数的应用。本题中第一次调用test()函数数值1,A,10.1;第二次调用少了一个实参,却要求输出2,B,3.5,由此分析,应将test()函数的第三个参数声明为默认参数。且默认为3.5,才能达到要求的输出结果。故应填入=3.5或者c=3.5。
转载请注明原文地址:https://kaotiyun.com/show/8MVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序: #include<stdio.h> main() { inti,s=0,t[]={1,2,3,4,5,6,7,8,9}; for(i=0;i<9;i+=2) s+=*(t+i); printf("%d\
在快速排序法中,每经过一次数据交换(或移动)后()。
设栈的存储空间为S(1:m),初始状态为top=m+1。经过一系列入栈与退栈操作后,top=m。现又在栈中退出一个元素后,栈顶指针top值为()。
下列叙述中正确的是()。
以下叙述中正确的是()。
有以下程序段 charc1,c2; for(c1=’0’,c2=’9’;c1<c2;c1++,c2--) printf("%c%c",c1,c2); 程序段的执行结果是()。
若a是数值类型,则逻辑表达式(a==1)||(a!=1)的值是()。
若有定义:inta,b;,通过语句scanf("%d;%d",&a,&b);能把整数3赋给变量a、5赋给变量b的输入数据是()。
在数据库系统中,数据模型包括概念模型、逻辑模型和()。
下列各序列中不是堆的是()。
随机试题
乙向甲借款5万,丙又欠乙5万,经过协商由丙直接向甲偿还,下列关于甲、乙、丙三者之间债的移转方式的说法中,正确的有()。(2014年)
WhathavetheEuropeancountriesagreedonattheBrusselsSummit?
“一国两制”的前提是
9岁男孩,左肘关节半屈位、手掌着地跌倒,伤后左肘部肿胀、疼痛、伴功能受限4小时就诊。查体:左肘部肿胀及压痛、半屈位畸形,左前臂及手部血运良好。X线片:左肱骨髁上伸直型骨折,移位不明显。下列哪项处理最恰当
血胆固醇升高时,血中相应浓度增加的是()
肺源性心脏病主要表现是
体现银行内控能力常用的内部指标包括三个方面:信贷资产质量、盈利性和流动性。()
银行承兑汇票二级市场行为不包括()
以下关于管理幅度和管理层次的说法,错误的是()。
动物的行为复杂多样,其中夏日田间的蛙声和蝉鸣声是动物的()。
最新回复
(
0
)