填空题
下列程序的输出结果是______。
#include<iostream>
using namespace std;
template<typename T>
T fun(T a,T b)return(a<=b) a:b;
int main( )
cout<<fun(3,6)<<’,’<<fun(3.14F,6.28F)<<endl;
return 0;
【参考答案】
C,C,AD
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
在下面的类定义中,this指针的用途是______。 #include<iostream.h> class Sample int x,y; public: Sample(int i,int j)x=i;y=j; void assign(Sample sa); ; void Sample::assign(Sample p) if(this!=&p) x=p.x; y=p.y;
点击查看答案&解析
填空题
根据三角形的基本定理完成填空,则表达式应为______。 #include<iostream.h> #include<math.h> void main( ) double a,b,e,s,area; cout<< 请输入三角形三边a,b,e, <<endl; cin>>a>>b>>c; if(______) s=(a+b+c) 2; area=sqrt(s*(s-a)*(s-b)*(s-c)); cout<< 三角形的面积为: <<area; else cout<< 不能构成三角形! <<endl;
点击查看答案&解析
相关试题
下列程序的运行结果是______。 #in...
下列程序的运行结果为______。 #in...
参照函数模板的写法,完成非模板函数的定义...
下列程序编译错误,因为add函数返回值是一...