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

[填空题]下列程序中需要清理动态分配的数组,划线处应有的语句是 【13】
#include<iostream, h>
class person int age, tall;
public:
person( ) age= 0; tall= 40; cout<<"A baby is born. "<<end1;
person(int i) age=i, tall=40, cout<<"A old person. "<<end1;
person(int i, int i) age = i; tall = j; cout <<" a old person with tall. "<<
end1;
~person( ) cout<<" person dead. "<<end 1;
void show( )

cout<<"age= "<<age<<" ,tall= "<<tall<<end1;

;
void main( ) person * ptr;
ptr = new person[3];
ptr[0]=person ( )
ptr[1]=person(18);
ptr[2]=person(20,120);
for(int i=0;i<3; i++)
ptr[i]. show( );
______

更多"下列程序中需要清理动态分配的数组,划线处应有的语句是 【13】 。#i"的相关试题:

[填空题]下列程序中需要清理动态分配的数组,划线处应有的语句是 【13】
#include<iostream, h>
class person int age, tall;
public:
person( ) age= 0; tall= 40; cout<<"A baby is born. "<<end1;
person(int i) age=i, tall=40, cout<<"A old person. "<<end1;
person(int i, int i) age = i; tall = j; cout <<" a old person with tall. "<<
end1;
~person( ) cout<<" person dead. "<<end 1;
void show( )

cout<<"age= "<<age<<" ,tall= "<<tall<<end1;

;
void main( ) person * ptr;
ptr = new person[3];
ptr[0]=person ( )
ptr[1]=person(18);
ptr[2]=person(20,120);
for(int i=0;i<3; i++)
ptr[i]. show( );
______

[填空题]下列程序中需要清理动态分配的数组,划线处应有的语句是______。
#include<iostream, h>
class person int age, tall;
public:
person( ) age= 0; tall= 40; cout<<"A baby is born. "<<end1;
person(int i) age=i, tall=40, cout<<"A old person. "<<end1;
person(int i, int i) age = i; tall = j; cout <<" a old person with tall. "<<
end1;
~person( ) cout<<" person dead. "<<end 1;
void show( )

cout<<"age= "<<age<<" ,tall= "<<tall<<end1;

;
void main( ) person * ptr;
ptr = new person[3];
ptr[0]=person ( )
ptr[1]=person(18);
ptr[2]=person(20,120);
for(int i=0;i<3; i++)
ptr[i]. show( );
______

[填空题]下列程序中需要清理动态分配的数组,划线处应有的语句是 【13】 。 #include<iostream, h> class person { int age, tall; public: person( ) { age= 0; tall= 40; cout<<"A baby is born. "<<end1;} person(int i) {age=i, tall=40, cout<<"A old person. "<<end1;} person(int i, int i) { age = i; tall = j; cout <<" a old person with tall. "<< end1;} ~person( ) {cout<<" person dead. "<<end 1;} void show( ) { cout<<"age= "<<age<<" ,tall= "<<tall<<end1; } }; void main( ) { person * ptr; ptr = new person[3]; ptr[0]=person ( ) ptr[1]=person(18); ptr[2]=person(20,120); for(int i=0;i<3; i++) ptr[i]. show( ); ______ }
[填空题]下列程序中需要清理动态分配的数组,划线处应有的语句是_______。 #include<iostream.h> class person { int age,tall; public: person( ){age=0;tall=40;cout<<"A baby is born."<<endl;} person(int i){age=i;tall=40;cout<<"A old person."<<endl;} person(int i,int j){age=i;tall=j;cout<<"a old person with tall."<<endl;) ~person( ){cout<<"person dead."<<endl;} void show( ) { cout<<"age="<<age<<",tall="<<tall<<endl; } }; void main( ) { person*ptr; ptr=new person[3]; ptr[0]=person( ); ptr[1]=person(18); ptr[2]=person(20,120); for(int i=0;i<3;i++) ptr[i].show( ); ______ }
[填空题]下列程序中需要清理动态分配的数组,划线处应有的语句是_______。
#include<iostream.h>
class person

int age,tall;
public:
person( )age=0;tall=40;cout<<"A baby is born."<<endl;
person(int i)age=i;tall=40;cout<<"A old person."<<endl;
person(int i,int j)age=i;tall=j;cout<<"a old person with tall."<<endl;)
~person( )cout<<"person dead."<<endl;
void show( )

cout<<"age="<<age<<",tall="<<tall<<endl;

;
void main( )

person*ptr;
ptr=new person[3];
ptr[0]=person( );
ptr[1]=person(18);
ptr[2]=person(20,120);
for(int i=0;i<3;i++)
ptr[i].show( );
______

[单项选择]下列程序中划线处正确的语句是( )。
# include <iostream>
using namespace std;
class Base

public:
void fun( )cout<<"Base:: fun" <<endl;

class Derived:public Base

void fun( )

______ ∥显式调用基类的函数fun( )
cout<<"Derived:: fun"<<endl;


A. fun();
B. Base.fun();
C. Base::fun();
D. Base- >fun();
[单项选择]下列程序中划线处正确的语句是( )。
#include <iostream>
using namespace std;
class Basepublic:
void fun( ) cout<<"Base:: fun"<<end1;
;
class Derived: public Base void fun( )

_______________________ //显试调用基类的函数 fun( )
cout <<"Derived:: fun"<<end1;
;
A. fun();
B. Base. fun();
C. Base:: fun();
D. Base->fun();
[单项选择]下列程序中,划线处正确的语句是( )。
#include<iostream.h>
Class Base

Public:
Void fun( )cout<<"Base::fun"<<endl;

Class Derived:public Base

void fun( )

______ //显示调用基类的函数fun( )
Cout<<"Derived::fun"<<endl;


A. fun()
B. Base.fun()
C. Base::fun()
D. Base->fun();
[单项选择]下列程序中,划线处正确的语句是( )。
#include<iostream.h>
Class Base

Public:
Void fun( )cout<<"Base::fun"<<endl;

Class Derived:public Base

void fun( )

______ //显示调用基类的函数fun( )
Cout<<"Derived::fun"<<endl;


A. fun()
B. Base.fun()
C. Base::fun()
D. Base->fun();
[单项选择]为完成下面的程序,应在划线处填入的语句是 #include<iostream> using namespace std; class Base { private: int x; public: Base (int i) { x=i; } ~Base( ){} }; class Derived:public Base { public: ______________//完成类Derive构造函数的定义 }; int main( ) { Derived Obj; return 0; }
A. Derived(int :Base({}
B. Derived(){}
C. void Derived (int :Base({}
D. Derived(int {Base(;}
[单项选择]为完成下面的程序,应在划线处填入的语句是( )。 #include <iostream> using namespace std; class Base { private: int x; public: Base(int i) { x=i; } ~Base( ){} }; class Derived : public Base { public: _______________ //完成类Derive构造函数的定义 }; int main( ) { Derived Obj; return 0; }
A. Derived(int :Base({}
B. Derived(){}
C. voidDerived(int :Base(0){}
D. Derived(int {Base(;}
[填空题]以下程序段给数组A的所有元素输入数据,请填空。 # include<iostream. h> void main ( ) { int a[10], i; i=0; while (i<10) cin>> [8] }

我来回答:

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

订单号:

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