问题 单项选择题

若有程序:
fun(int a,int B)

static int c=0;
c+=a+b;
return c;

main()

int x=5,y=3,z=7,r
r=fun((y,x+y),z);
r=fun(x,y);
printf("%d\n",r);

上面程序的输出结果是_______。

A.23

B.15

C.19

D.18

答案

参考答案:A

解析:[评析] static声明的外部变量只限于被本文件引用,而不能被其他文件引用。用static来声明一个变量的作用有:①对局部变量用static声明,则为该变量分配的空间在整个程序执行期间始终存在;②全部变量用static声明,则该变量的作用域只限于本文件模块(即被声明的文件中)。调用第一个fun,其两个实参的值为(3,5+3)与7即8与7,在函数fun执行结束返回15。第二次调用fun时,由于static为静态类型,其值保留,执行fun(5,3)后,其返回值为23,故选A。

阅读理解

阅读理解:

A

There are three branches of medicine. One is called “doctor medicine,” or “scientific medicine.” Scientific doctors try to observe sicknesses, look for logical patterns, and then find out how the human body works. From there they figure out what treatments may work. This kind of medicine is believed to date from the 4th century BC. Although nowadays it is successful, in the ancient world this approach probably did not cure many patients.

A second kind of medicine is called “natural cures,” or “folk medicine,” in which less educated people try to cure sicknesses with various herbs(中草药). These folk healers also use observation and logic, but they are not so aware of it. They try things until they find something that seems to work, and then keep doing that. Folk medicine flourished long before the development of scientific medicine and was more successful in ancient times than doctor medicine.

The third kind is called “health spas,” or “faith healing.” Sometimes this may be as simple as touching the holy man and being immediately healed. Other times, a magician may make you a magic charm, or say a spell, to cure you. Some religious groups organize special healing shrines for the sick. In these places people rest, get plenty of sleep, eat healthy food, drink water instead of wine, and exercise in various ways. They also talk to the priests and pray to the gods. If you are feeling depressed or you have been working too hard, going to these places may be just the right thing to make you feel better.

1. Doctor medicine ________.

A. has a longer history than folk medicine

B. has been practiced for around 1,600 years

C. bases its treatments on observation and logic

D. was very successful in curing sicknesses in ancient times.

2. According to the passage, which of the following is NOT used in health spas?

A. Magic power.                         B. Various herbs.

C. Religious faith.                       D. A healthy life style.

3. According to the passage, which of the following statements is true?

A. Folk healers choose different herbs to cure diseases without any sound basis.

B. People who practice folk medicine need lots of formal education on herbs.

C. The success of folk medicine led to the development of doctor medicine.

D. Natural cures worked better than scientific medicine in ancient times.

4. The author’s primary purpose in this passage is to _______.

A. describe different types of medicine

B. argue for the importance of medicine in health care.

C. show the crucial(决定性的) role religion plays in medical treatments.

D. compare the educational background of three different types of patients.

单项选择题