问题 单项选择题

有以下程序
main()
char k;int i;
for(i=1;i<3;i++)
scanf("%c",&k);
switch(k)
case’0’:printf("another\n");
case’1’:printf("number\n");



程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是

A.another
number
anothor

B.another
number
number

C.another
number

D.number
number

答案

参考答案:C

解析:switch语句的执行过程是:在switch后面的表达式的值和case后面常量表达式的值吻合时,就执行后面的语句。如果在该语句的后面没有break语句,则继续执行下一个case,直到遇到break语句或switch多分支则结束,在switch语句中,break语句的作用是使流程跳出switch结构,中止switch语句的执行。本题中在for循环中嵌套了 switch语句,每循环一次通过scanf()函数从键盘上输入一个k值,然后执行switch语句。 for循环共循环了2次,当i=1时,从键盘上输入0,使得k的值为0,执行switch语句中 cast:0后面的语句,输出another,接着执行case:0下面的语句输出number,退出switch语句,当i=2时,从键盘上输入1,使得k的值为1,执行switch语句中case:1后面的语句,输出number,退出switch语句。当i=3时退出循环。故最后的输出为another、number和 number。

多项选择题
单项选择题

Young girls at high risk for depression appear to have a malfunctioning reward system in their brains, a new study suggests. The finding comes from research that (1) a high-risk group of 13 girls, aged 10 to 14, who were not depressed but had mothers who (2) recurrent depression and a low-risk group of 13 girls with no (3) or family history of depression. Both groups were given MRI brain (4) while completing a task that could (5) either reward or punishment.

(6) with girls in the low-risk group, those in the high-risk group had (7) neural responses during both anticipation and receipt of the reward. (8) , the high-risk girls showed no (9) in an area of the brain called the dorsal anterior cingulated cortex (背侧前扣带皮质), believed to play a role in (10) past experiences to assist learning.

The high-risk girls did have greater activation of this brain area (11) receiving punishment, compared with the other girls. The researchers said that this suggests that high-risk girls have easier time (12) information about loss and punishment than information about reward and pleasure.

"Considered together with reduced activation in the striatal (纹状体的) areas commonly observed (13) reward, it seems that the reward-processing system is critically (14) in daughters who are at elevated risk for depression, (15) they have not yet experienced a depressive (16) ," wrote Ian H. Gotlib, of Stanford University, and his colleagues. " (17) , longitudinal studies are needed to determine whether the anomalous activations (18) in this study during the processing of (19) and losses are associated with the (20) onset of depression," they concluded. The study was published in the April of the Archives of General Psychiatry.

11()

A.why

B.when

C.wherever

D.whereas