题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-14 02:05:48

[填空题]在下面程序横线处填上适当内容,使得程序的输出为9876。 #include <iostream> using namespace std; template<class T> void f( 【12】 ) { T t; for (int i=0;i<n/2;i++) { t=a Ii]; a [i]=a[n-1-i]; a [n-1-i]=t; } } int main ( ) { int x[]={6,7,8,9}; f(x,4); for (int i=0;i<4;i++) cout<<x[i]; cout<<end1; return 0; }

更多"在下面程序横线处填上适当内容,使得程序的输出为9876。 #in"的相关试题:

[填空题]在下面程序横线处填上适当内容,使得程序的输出为9876。
#include <iostream>
using namespace std;
template<class T>
void f( 【12】 )

T t;
for (int i=0;i<n/2;i++)

t=a Ii];
a [i]=a[n-1-i];
a [n-1-i]=t;


int main ( )

int x[]=6,7,8,9;
f(x,4);
for (int i=0;i<4;i++)
cout<<x[i];
cout<<end1;
return 0;

[填空题]在下面程序横线处填上适当内容,使程序输出为:55599。
#include <iostream>
using namespace std;
template <class TYPE>
class HisClass

TYPE data;
public:
HisClass(TYPE a, TYPE b, TYPE C) ;
TYPE getData( ) return data;)

template<class TYPE>
HisClass<TYPE>::HisClass(TYPE a,TYPE b,TYPE C)

【12】
else主f(b>C)
data=b;
else
data=c;

int main( )

HisClass<int> x1(3,4,5),x2(5,3,4),x3(4,5,3),x4(7,8,9),x5(8,7,9);
cout<<x1.getData( )<<x2.getData( )<<x3.getData( )
<<x4.getData( )<<X5.getData( );
return 0;

[填空题]在下面程序横线处填上适当内容,以使该程序执行结果为4.4。
#include<iostream>
using namespace std;
template<typename T>
T average(T*datA)

T s=0;
int i:0;
while(data[i])
【12】
return s/(i+1);

int main( )

double x[]=2.5,4.5,6.5,5,0.0,12.5,23.3,18.5;
cout<<average(X);
return 0;

[简答题]在下面程序中的横线处填上适当内容,使程序完整
#include<iostream.h>
______
class A

int i;
public:
int set(B&);
int get( )return i;
A(int x)i=x;

class B

int i;
public:
B(int x)i=x;
______A;

int A::set(B &b)

return i=b.i:

void main( )

A a(1);
B b(2);
cout<<a.get( )<<",";
a.set(b);
cout<<a.get( )<<endl;

[填空题]在下面程序的横线处填上适当的语句,使该程序的输出为12。
#include <iostream>
using namespace std;
class Base

public:
int a;
Base(int i)a=i;
;
class Derived: public Base

int a;
public:
Derived(int x): Base(x),b(x+l)
void show( )

【11】 ;∥输出基类数据成员a的值。
cout<<b<<end1;


int main( )

Derived d(1);
d.show( );
return 0;

[填空题]在下面的程序的横线处填上适当的语句,是该程序的输出为12。
#include<iostream>
using namespace std;
class Base

public:
int a;
Base(int i)a=i;

class Derived:public Base

int a;
public:
Derived(int x):Base(x),b(x+1)
void show( )

【11】 ; //输出基类数据成员a的值。
cout<<b<<endl;


int main( )

Derived d(1);
d.show( );
return 0;

[填空题]在下面的程序的横线处填上适当的语句,使该程序的输出为12。 #include<iostream.h> using namespace std; class Base { public: int a,b; Base(int i){a=i;} }; class Derived:public Base { int a; public: Derived(int x):Base(x),b(x+1){}; void show( ) { ______;//输出基类数据成员a的值 cout<<b<<endl; } }; int main( ) { Derived d(1); d.show( ); return 0;
[简答题]在下面程序横线处填上适当的语句,使其输出结果为0,15,15。
#include<iostream.h>
class base
public:
______f( )return 0;

class derived:public base
public:
int a,b,c;
______set(int x,int y,int z)a=x;b=y;c=z;
int f( )return a+b+c;

void main( )
base b;
derived d;
cout<<b.f( )<<",";
d.set(3,5,7);
cout<<d.f( )<<",";
base &p=d;
cout<<p.f( )<<endl;

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码