问题 问答题

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
class A
public:
A(const char*na)strcpy(name,na);
private:
char name[80];

class B:public A
public:
B(const char*nm):A(nm)
void show();

void B::show()
cout<<"name:"<<name<<endl;

void main()
B b1("B");
b1.show();

答案

参考答案:private:因为name如果是私有的,在派生类中无法访问,而基类没有提供成员函数来访问name,所以更改name访问权限为公有或保护,这样对于派生类来说是透明的。应改为public:或protected:。

完形填空
完形填空 (30分)
阅读下面短文,从短文后所给的四个选项中,选出可以填入空白处的最佳选项。
A
In today’s world, pollution has become a serious problem.  51.  we know, air pollution is harmful to our health. However, not all people know that noise    52  also a kind of pollution and is harmful to human health.
People who work and live in noisy conditions may become   53  . For example,  many of the workers who   54. newspapers and books become deaf. Quite a few people living near   55 also have hearing lose. Recently it was reported that many teenagers in America  56 hear better than the old do, because these young people always listen to  57 pop music.  Making a loud noise in public is also a kind of pollution, it not only  58  others but also does great harm to hearing. Cars and machines also produce 59 noise. It makes people feel uncomfortable and unpleasant.  60  , it can cause them to be sick or deaf.Nowadays many countries are trying to solve all sorts of environmental problems, including noise pollution.
小题1:
A.SoB.WhileC.AsD.And
小题2:
A.areB.isC.wasD.were
小题3:
A.excitedB.deadC.thinD.deaf
小题4:
A.makeB.printC.catchD.take
小题5:
A.factoriesB.airportsC.schoolsD.gyms
小题6:
A.canB.mayC.can’tD.mustn’t
小题7:
A.slowB.lightC.fastD.loud
小题8:
A.helpsB.disturbsC.causesD.makes
小题9:
A.much tooB.lots ofC.a littleD.too many
小题10:
A.By the wayB.we knowC.For exampleD.What’s more
单项选择题 共用题干题