问题 单项选择题

有以下程序: struct STU {char name[10];int num;float TotalScore;}; void f(struct STU *p) {struct STU s[2]={{"SunDan",20044,550},{"Penghua",20045,537}},*q=s; ++p;++q; *p=*q; } main() {struct STU s[3]={{"YangSan",20041,703},{"LiSiGuo",20042,580}}; f(s); printf("%s%d%3.0f\n",s[1].name,s[1].num,s[1].TotalScore); } 程序运行后的输出结果是【 】。

A.SunDan 20044 550

B.Penghua 20045 537

C.LiSiGuo 20042 580

D.SunDan 20041 703

答案

参考答案:B

解析:本题将结构体数组s的首地址传递给了结构体指针变量p,并在函数f中改变了指针变量p所指向的第二个结构体中的成员变量,这一改变,也就是改变了主函数中s[1]的成员变量,故程序输出的值为Penghua 20045 537。

单项选择题

Randy Kraus was paralyzed. His left side was useless. But his right hand was (1) enough to lift a bucket to his forehead. Once, he’d been a police officer and owned a private-eye agency. Once, he’d been p and able. Now, he felt he was nothing.

His (2) started with Parkinson’s disease, but it didn’t (3) there. In July 2002, the 60 year old Kraus went into the hospital for an operation to control the shaking. (4) , during the operation, he had a stroke. He was paralyzed. The (5) man, who loved golf, could think, but couldn’t (6) . Kraus wanted the doctors to (7) it to him straight. "You may never walk again, " they told him. "Maybe you won’t (8) be able to talk. "

Once at home, he (9) he couldn’t lift a fork or take a drink by himself. Physical treatment was so painful and slow. What did he have to (10) for So now Kraus held the gun against his head. (11) the cold metal on his skin, he began to consider not his pain, but the pain he (12) cause his wife, daughters and grandchildren. He didn’t pull the trigger.

"You are where you are", his exercise physiologist, Andrew Garud told him. "The pace would be slow; the pain would be (13) . But as long as you are (14) , you have the ability to get better. " After three months of (15) with Garud, Kraus wanted to see if he could (16) . He could. Then he took three steps, sat down and cried like a baby. One step (17) to another. Next he managed a short walk. It was the hardest (18) of Kraus’s life.

Garud kept saying he could (19) more. Now, Kraus can brush his teeth, shave himself and get around the house with a walker. Little success only the paralyzed can (20) understand.

8().

A.still

B.only

C.just

D.even

选择题