首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的输出结果是( )。 #include using narnespace std; template T fun(T a,T b){return(a
下列程序的输出结果是( )。 #include using narnespace std; template T fun(T a,T b){return(a
admin
2012-12-29
23
问题
下列程序的输出结果是( )。
#include
using narnespace std;
template
T fun(T a,T b){return(a<=b)?a:b;}
int main()
{
cout<
return 0;
}
选项
A、0,3.14
B、3,3.14
C、3,3
D、3.14,3.14
答案
B
解析
此函数模板的功能是输出a、b两数中较小的那个数。(3,6)输出3,(3.14F6.28F)输出3.14。
转载请注明原文地址:https://kaotiyun.com/show/95Vp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序:#includeintflintt[],intn);main(){inta[4]={1,2,3,4},s;s=f(a,2);printf("%d\n",s);}i
以下关于字符串的叙述中正确的是()。
下述程序的输出结果是()。#include<stdio.h>voidmain(){chara=1,b=2;charc=a^b<<2:printf(’’\n%d’’,c);}
以下叙述中错误的是()。
函数fun的功能是:将一副扑克牌编号为1,2,3,…,53,54,以某种特定的方式洗牌,这种方式是将这副牌分成两半,然后将它们交叉,并始终保持编号为l的牌在最上方,如第一次这样洗牌后的结果为:1,28,2,29,…,53,27,54。两次洗牌后的结果为:1
对长度为n的线性表排序,在最坏情况下,比较次数不是n(n-1)/2的排序方法是()。
深度为5的完全二叉树的节点数不可能是()。
设栈的存储空间为S(1:m),初始状态为top=m+1。经过一系列入栈与退栈操作后,top=m。现又在栈中退出一个元素后,栈顶指针top值为()。
某完全二叉树共有256个节点,则该完全二叉树的深度为()。
在按层次遍历二叉树的算法中,需要借助的辅助数据结构是()。
随机试题
一黑白花奶牛,4岁多,体重约450kg,1周前顺产,现发现该牛精神沉郁,食欲下降,渐进性消瘦,乳汁减少。临床检查:患牛呼吸脉搏及体温无明显变化,瘤胃空虚,蠕动无力,粪便干硬,外覆黏液,乳房肿胀其浅表静脉明显扩张,泌乳量减少,乳汁有特殊的烂苹果气味,阴户常有
生命神圣论的积极意义不包括的是
城市规划实施的首要目的就是()。
商检机构可以接受外国有关机构的委托进行进出口商品质量认证工作,准许在认证合格的进出口商品上使用质量认证标志。( )
用应付未付外债总额与当年出口收入之比衡量一国长期资金的流动性,一般的限度为()。
下列属于泄露客户信息的行为()。
根据票据法的规定,如果收款人或持票人将出票人作禁止背书的汇票转让,在汇票不获承兑时,下列有关出票人票据责任的表述中,正确的是()。
下列地区中,未列入实施西部大开发战略的是()
假设一条指令的执行过程分为“取指令”、“分析”和“执行”3段,每一段的时间分别为t、2t 和 3t。在下面的情况下,分别写出连续执行n条指令所需要的时间表达式。(1)顺序执行方式(48)。(2)仅“取指令”和“执行”重叠(49)。(3)“取指令”、“分析”
请使用VC6或使用【答题】菜单打开考生文件夹proj1下的工程proj1,该工程中包含程序文件main.cpp,其中有类Door(“门”)和主函数main的定义。程序中位于每个“//ERROR****found****”之后的一行语句有错误,请加以改正。改
最新回复
(
0
)