当前位置:计算机科学技术题库>CPP考试题库

问题:

[单选]

1)#include < iostream >
2)# include < math.h >
3)using namespace std;
4)double max(double x,doubley);
5)void main()
6){
7)double   a,b,c;
8)cout << " input two numbers: ";
9)cin>>a>>b;
10)c=max(a,b);
11)cout<< " the squart of max imum="<< sqrt(c);
12)}
13)double max(doublex,doubley)
14){
15)if(x>y)
16)returnx;
17)else
18)returny;
19)}

若执行第9行时,输入89后按回车,则程序第11行输出:()

A . A.the squart of max imum=sqrtC.
B . the squart of max imum=3.08221
C . the squart of max imum=3
D . the squart of max imum=9.0

在贴膜手机银行“系统管理--恢复出厂设置”的交易中,需录入正确的(),即可成功恢复出厂设置。 A、登录密码。 B、支付密码。 C、查询密码。 D、账户密码。 高密度脂蛋白胆固醇(HDL-C)的正常值是() 1.04~1.55mmol/L。 2.1~3.12mmol/L。 0.56~1.7mmol/L。 1.04~1.7mmol/L。 1.5~2.1mmol/L。 在专用地铁卡补办、停用期间须()进出付费区。 贴膜手机银行中“手机交易查询”支持查询()的交易。 A、一个月内。 B、2个月内。 C、3个月内。 D、6个月内。 二、三类动物疫病呈暴发性流行时,按照()动物疫病处理。

1)#include < iostream >
2)# include < math.h >
3)using namespace std;
4)double max(double x,doubley);
5)void main()
6){
7)double   a,b,c;
8)cout << " input two numbers: ";
9)cin>>a>>b;
10)c=max(a,b);
11)cout<< " the squart of max imum="<< sqrt(c);
12)}
13)double max(doublex,doubley)
14){
15)if(x>y)
16)returnx;
17)else
18)returny;
19)}

若执行第9行时,输入89后按回车,则程序第11行输出:()
参考答案:

  参考解析

若执行第9行时,输入“89后按回车”,在接下来的函数执行过程中利用求最大值函数对两个数进行比较,将大的数赋给c,在11行输出这个最大值的开平方,9.0(小数位数由编译器决定)>8.0(小数位数由编译器决定),所以返回9.0(小数位数由编译器决定)并存放在c中,并对c开平方,所以c中的变量变为3.0(c的返回值是双精度浮点型),但在cout输出中,输出整数时会省略后面的零输出。

在线 客服