网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下列程序的输出结果是______。
include<iostream.h)
template<class T>
Tmax(T x[],int n)
{
int i;
T maxv=x[0];
for(i=1;i(n;i++)
if(maxv maxv=x[i];
return maxv;
}
void main()
{
inta[]={3,2,7,6,8,9};
double b[]={1.2,3.4,2.5,7.3,6
参考答案
更多 “ 下列程序的输出结果是______。include<iostream.h)template<class TTmax(T x[],int n){int i;T maxv=x[0];for(i=1;i(n;i++)if(maxv maxv=x[i];return maxv;}void main(){inta[]={3,2,7,6,8,9};double b[]={1.2,3.4,2.5,7.3,6 ” 相关考题
考题
下面程序的输出结果是【】。define MIN(a,b) (((a)void main(){int
下面程序的输出结果是【 】。define MIN(a,b) (((a)<(b))?a:b)include <iostream.h>void main(){int x= 3, y=5;cout<< MIN(x,y)<<end1;}
考题
下列程序的输出结果是【 】。include void swap(int *a, int *B) { int *t; t=a;a=b;b=t;
下列程序的输出结果是【 】。include <stdio.h>void swap(int *a, int *B){int *t;t=a;a=b;b=t;}main(){int i=3,j=5,*p=i,*q=j;swap(p,q);printf("%d %d\n",*p,*q);}
考题
下列程序的输出结果是______。 include template T max(T x[],int n) { int
下列程序的输出结果是______。include<iostream.h>template<class T>T max(T x[],int n){int i;T maxv=x[0];for(i=1;i<n;i++)if(maxv<x[i])maxv=x[i];return maxv;}void main( ){int a[]={3,2,7,6,8,9};double b[]={1.2,3.4,2.5,7.3,6.8};cout<<max(a,4)<<","<<max(b,3)<<endl;}
考题
以下程序的运行结果是______。 include include template class TA
以下程序的运行结果是______。include<iostream.h>include<math.h>template<class T>class TAdd//定义类模板TAdd,T为类型{Tx,y;public:TAdd (Ta,Tb) {x=a,y=b;) //构造函数Tadd() { retum x+y;}//成员函数};void main( ){TAdd<int>A (5,6);
考题
以下程序的执行结果是()。includetemplateclass Sample{ T n;Public: Samp
以下程序的执行结果是( )。 #include<iostream.h> template<class T> class Sample { T n; Public: Sample (T i){n=i;) void operator ++(); void disp() {cout<<"n="<<n<<endl;} }; template<class T> void Sample<T>:: opetatA.n=aB.a=OC.n=bD.a=b
考题
下列程序段的输出结果是includevoid fun(int * x,int * y){cout
下列程序段的输出结果是 #include<iostream.h> void fun(int * x,int * y) { cout << * X << * y; *X=3; *y=4; } void main() { int x=1,y=2; fun(y,x); cout << X << y<<endl; {A.2143B.1212C.1234D.2112
考题
下面程序的输出结果是()。includeusing namespace std;templateT max(T x,T
下面程序的输出结果是( )。 #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.2B.10 18C.10 3.2D.编译出错
考题
下列程序段的输出结果是includevoid fun(int*x,int*y){cout
下列程序段的输出结果是 #include<iostream.h> void fun(int*x,int*y) {cout<<*x<<*y; *X=3; *y=4; } void main() {int x=1,y=2; fun(&y,&x); cout<<X<<y<<endl; }A.2143B.1212C.1234D.2112
考题
下列程序段的输出结果是 include void fun(int * X,int * y) {cout
下列程序段的输出结果是 #include<iostream.h> void fun(int * X,int * y) { cout < < * X < < * y; * X=3; * y=4; } void main( ) { int x=1,y=2; fun(y,x); cout < < X < < y < < end1; }A.2143B.1212C.1234D.2112
热门标签
最新试卷