问题 单项选择题

有如下程序:
#include<iostream>
using namespace std;
class A
public:
static int a;
void init() a= 1;

A(int a=2) init(); a++;
;
int A::a=0;A obj;
int main()
cout<<obj.a;
return 0;A) 0
B) 1
C) 2
D) 3

答案

参考答案:B

解析: 此题实际考查的是变量作用域的屏蔽效应。在C++中,当标识符的作用域发生重叠时,在一个函数中声明的标识符可以屏蔽函数外声明的标识符或全局标识符。声明类A的全局对象时,构造函数首先调用int函数,但由于静态成员变量a被构造函数内部的形参a所屏蔽所以a++改变的是形参a的值,对静态成员变量a没有影响。

改错题
阅读理解

阅读理解

     Given Australia's size and the fact that early settlements were far apart, Australian society is

remarkably homogeneous (同种的). Its citizens are fundamentally prosperous and the way of life

in the major cities and towns is much the same however many miles divide them. It_takes_a_sharp

_ear_to_identify_regional_accents.

     However, there is some difference in lifestyle between city dwellers and the country people.

Almost 90 percent of the population lives in the fastpaced cities along the coast and has little more

than a passing familiarity with the desert. The major cities preserve pockets of colonial heritage, but

the overall impression is modern, with new buildings reflecting the country's youth. In contrast, the

rural communities tend to be slowmoving and conservative. For many years, Australia was said to

have "ridden on the sheep's back", a reference to wool being the country's main moneyearner.

However, the wool industry is no longer dominant. Much of Australia's relatively sound economy

is now achieved from natural coal and wheat, and by being the largest diamond producer in the

world. Newer industries such as tourism and wine making are also increasingly important. Australians

are generally friendly and relaxed, with a selfdeprecating sense of humour. On the whole, Australia is

a society without hierarchies (等级制度), an attitude generally held to stem from its prisoner

beginnings.

      Yet, contrary to widespread belief, very few Australians have true prisoner origins. Within only

one generation of the arrival of the First Fleet in 1788, Australia had become a nation of immigrants.

Originally coming almost entirely from the British Isles, today one in three Australians comes from

elsewhere. Australia's liberal postwar immigration policies led to an influx of survivors from wartorn

Europe, most notably Greeks, Italians, Poles and Germans.

     The emphasis has shifted in recent years and today the majority of new immigrants are from

Southeast Asia. Today Australia is a 'blend of nations' and although some racism exists, it has

generally been a successful experiment and the country is justifiably proud to have one of the most

harmonious multicultural communities in the world.

1. What does the writer mean by saying "It takes a sharp ear to identify regional accents." in the first

     paragraph?

A. Australians speak Standard English with no local accents whatsoever.

B. You have to practice a lot to learn to understand the different accents.

C. The Australian regional accents are very difficult to understand indeed.

D. There is not much difference between the accents in different areas of Australia.

2. Which of the following statements is TRUE according to the passage?

A. Most Australians have ancestors who were prisoners.

B. The Australian economy is dependent on sheep exports.

C. The majority of people living in Australia come from Europe.

D. The pace of life is different in the city and in the country.

3.The underlined pronoun "it" in the final paragraph refers to "________".

A. community  

B. racism

C. blend of nations  

D. Southeast Asia

4. We can infer from the passage that ________.

A. there are no signs of Australia's colonial past in its modern cities

B. Australia's recent immigration policy encourages immigrants from Southeast Asia

C. immigrants from Southeast Asia have brought racial problems

D. "riding on sheep's back" resulted in slow development in rural communities

5. This passage mainly focuses on Australia's ________.

A. society  

B. economy

C. racial problems  

D. history