A.AutoExec
B.Autoexe
C.Auto
D.AutoExec.bat
第1题
若下列程序运行时输出结果为
1,A,10.1
2,B,3.5
请将程序补充完整。
include<iostream>
using namespace std;
int main()
{
void test(int,char,double______);
test(1,'A',10.1);
test(2,'B');
return 0;
}
void test(int a,char b,double c)
{
cout<<a<<','<<b<<','<<c<<end1;
}
第2题
下列程序的输出结果为2,请将程序补充完整。
include<iostream>
using namespace std;
class Basc
{
public:
【 】void fun(){cout<<1;}
};
class Dcrived:public Base
{
public:
void fun(){cout<<2;}
};
int main()
{
Base*p=new Derived;
p->fun();
delete p;
return 0;
}
第3题
下列程序的输出结果为2,请将程序补充完整。
include <iostream>
using namespaee std;
class Base{
public:
______void fun(){cout<<1;}
};
class Derived:public Base{
public:
void fun(){cout<<2;}
};
int main(){
Base*P=new Derived:
p->fun();
delete P;
return 0;
}
第4题
请将下列程序的横线处补充完整,使得输出结果为bbaa
include<iostream>
using namespace std;
class A{
public:
______{cout<<"aa";}
};
class B:public A{
public:
~B(){cout<<"bb";}
};
int main(){
B*p=new
第5题
请将如下程序补充完整,使得输出结果为:bbaa
include <iostream>
using namespace std;
class A {
public:
【 】{cout << "aa"; }
};
class B: public A{
public:
~B(){ cout << "bb"; }
};
int main () {
B *p= new B;
delete p;
return 0;
}
第6题
请将如下程序补充完整,使得输出结果为:bbaa。
include<iostream>
using naluespace std;
class A{
public:
______{eout<<"aa";}
};
class B:public A{
public:
~B(){eont<<"bb";}
};
int ulain(){
B*P=new B;
delete P;
return 0;
}
第7题
(14 )请将如下程序补充完整,使得输出结果为: bbaa
#include<iostream>
using namespace std;
class A{
public:
___________{cout<<"aa";}
};
class B:public A{
public:
~B(){cout<<"bb";}
};
int main(){
B *p=new B;
delete p;
return 0;
}
第8题
已知下列程序的输出结果是23,请将横线处缺失的部分补充完整。
include<iostream>
using namespace std;
class MyClass{
public:
void Print()const{cout<<23;}
};
int main(){
MyClass*p=new MyClass();
______.Print();
return 0;
}
第9题
已知下列程序的输出结果是42,请将下画线处缺失的部分补充完整。
include <iostream>
using namespace std;
class Foo{
int value;
public:
Foo():value(0){}
void setValue(int value)
{______=value;}//给Foo的数据成员value赋值
void print(){eout<<value;}
};
int main(){
Foo f;
f.setValue(42);
f.print();
return 0;
}
第10题
下列程序的输出结果为
Object id=0
Object id=1
请将程序补充完整。
include <iostream>
using namespace std;
class Point
{
public:
Point(int xx=0,int yy=0) {X=xx;Y=yy;countP++;}
~Point(){countP--;}
int GetX(){return X;}
int GetY(){return Y;}
static Void GetC(){cout<<"Object id="<<countP<<endl;}
private:
int X,Y;
static int countP;
};
______ //静态数据成员的初始化
int main ()
{
Point::GetC();
Point A(4,5);
A.GetC();
return 0;
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!