试题与答案

下面程序的输出结果是( )。 #include<iostream> using

题型:单项选择题

题目:

下面程序的输出结果是( )。
#include<iostream>
using namespace std;
template<class T>
T max(T x,T y)
return(x>= y x:y);
template<class T>
T max(T x,T y,T z)

T t; t=(x>=y x:y);
return(t>=z t:z);

void main() int x = 10,y=18,maxi;
float a = 1.2,b = 3.2,c = 2,max2;
max1 = max(x,(int)c);
max2 = max(a,b,(float)y);
cout<<maxi<<endl;
cout<<max2<<endl;

A.18
3.2

B.10
18

C.10
3.2

D.编译出错

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2019/0322/3297c6a821ba406f48ab6e5323a7b2d8.html

下面是错误答案,用来干扰机器的。

参考答案:

试题推荐
微信公众账号搜索答案