问题 单项选择题

有以下程序 main() { int i,n=0; for(i=2;i<5;i++) { do{if(i%3)continue;n++; }while(!i); n++; } printf("n=%d\n",n); } 程序执行后输出结果是

A.n=5

B.n=2

C.n=3

D.n=4

答案

参考答案:D

解析:do…while的结构形式为:do循环体,while(条件表达式),当程序执行到do后,先执行循环体一次,然后才对条件表达式进行计算、判断。若条件表达式的值为真,则重复执行一次循环体;否则退出,与while结构相比,do…while结构至少要执行一次循环体;运算符%是求模运算,即求两个数相除的余数。continue语句的作用时结束本次循环,即跳过本次循环中余下尚未执行的语句,接着再一次进行循环的条件判定。本题中,当i=2时,执行do循环。由于if表达式的条件为真,执行continue语句,结束本次循环,判断while循环条件为假,故退出while循环,执行n++,此时n的值为1,当i=3时,执行do循环。由于if(3%3)为假,执行下面的n++语句,此时n的值为2,结束本次循环,继续判断while循环条件为假,故退出while循环,执行n++语句,此时n的值为3;当i=4时,执行do循环。由于if(4%3)为真,执行continue语句,结束本次循环,继续判断 while循环条件为假,故退出while循环,执行n++,此时n的值为4;当i=5时,退出for循环,因此最后输出的n的值为4。

阅读理解

阅读理解。

     If a person forgets names, places or facts -and has trouble with everyday things like reading or

shopping-it may not mean you are getting old. It could be Alzheimer's disease. So it's important to see

a doctor as soon as you can.

     There is no cure for Alzheimer's. But a drug called ARICEPT has been used by millions of people

to help their symptoms (症状).

      In studies, ARICEPT has been proved to work for Alzheimer's. It has helped people improve their

memory over time. It has also helped them to keep doing everyday things on their own.

     Ask your doctor if ARICEPT is right for you or your loved one. It is the Number One drug for

Alzheimer's in the world. The sooner you know it's Alzheimer's, the better ARICEPT can help.

     ARICEPT is good for many but may not be good for everyone. Some people may experience not

sleeping well, feeling very tired, or not wanting to eat. In studies, these side effects weren't serious at

all and went away over time. Some people taking ARICEPT may feel light-headed. In this case you

should tell your doctors because your condition may get worse.

1. If one suffers from Alzheimer's, _____.

A. he has trouble with his memory

B. he can't do everyday things on his own

C. he often forgets things because he is old

D. he can't move about

2. What is ARICEPT?

A. A medicine to cure Alzheimer's

B. A medicine to delay signs of aging.

C. A medicine to reduce the symptoms of Alzheimer's.

D. A medicine to cure brain damage.

3. One who is taking ARICEPT should go to see a doctor if he _____.

A. can't fall asleep

B. feels tired out

C. has no desire to eat

D. feels like a drunken man

单项选择题