问题 填空题

以下程序运行后的输出结果是 _______ 。};main(){ struct NODEs[3]={{1,’’\0’’},{2,’’\0’’},{3,’’\0’’}},*p,*q,*r;intsum=0; s[0].next=s+1;s[1].next=s+2;s[2].next=s; p=s; q=p->next; r=q->next;sum+=q->next->num;sum+=r->next->next->num;printf("%d\n",sum);}

答案

参考答案:E

解析:程序通过语句“s[0].next=s+1; s[1].next=s+2; s[2].next=s;”将结构体变量 s 中各结点链接成了一个 循环链表,即最后一个结点的指针域指向了头结点(s[2].next=s;),整个链表形成一个环,并通过语句“p=s; q=p->next; r=q->next;”将结构体指针变量 p、q、r 指向了各结点,故本题输出的 sum=3+2=5。

阅读理解

Dear Disney,
Last weekend, the four members of my family spent an enjoyable holiday at the Magic Kingdom - Disneyland. And one event made our visit seem truly magical. We got to the front of the line at Space Mountain, only to find out that our little daughter Gloria couldn't take her ice-cream on the ride. We were so excited that we all forgot ice-cream was not allowed on the ride.

Gloria broke into tears and we all had no idea what to do. Then Murphy, one of the staff(员工) members, came over. She bent down and told Gloria that she would hold the ice-cream for her and give it to her when she finished the ride. Gloria said, "Promise?" Then she gave Murphy her ice-cream, and she completely enjoyed the ride.
Sure enough, as we walked out the exit, there was Gloria's new friend with "her" ice-cream. Now you and I both know what happened, because we know that an ice-cream won't last twenty minutes on a summer afternoon in Florida. Murphy knew' what time we would get off the ride; she went to the nearest shop and bought a brand-new ice-cream thirty seconds before we walked out the exit. Gloria said, "Thank you," but I'm sure she thought it was the same ice-cream.
We know that someone tried hard to make our visit special. Thanks so much for going above and beyond!
Your fan,
Carmen Rivera
小题1:The family's visit to the Magic Kingdom was ________.
A.helpful -B.awfulC.frighteningD.amazing
小题2:Before the ride, Gloria cried because _________.
A.she couldn't find her parents in the line
B.she was too little to take the ride
C.she couldn't take her ice-cream on the ride
D.she had to wait for twenty minutes
小题3:Murphy was waiting for Gloria ___________ after the ride.
A.in the ice-cream shopB.at the exit
C.in the front of the lineD.at the entrance
小题4:In order to keep the promise, Murphy __________.
A.took Gloria to the nearest shop
B.asked her new friend to help Gloria
C.helped Gloria get off the ride
D.bought a new ice-cream for Gloria
小题5:The underlined word "someone" in the last paragraph refers to (指的是) _________.
A.MurphyB.DisneyC.GloriaD.Carmen
小题6:Carmen Rivera wrote the letter to __________.
A.order ice-creamsB.promise to visit again
C.express her thanksD.give some suggestions
选择题