问题 单项选择题

有以下程序
struct STU
char name[10];
int num;
int Score;

main()
struct Stu s[5]="YangSan",20041,703,"LiSiGuo",20042,580,
"WangYin",20043,680,"SunDan",20044,550,
"Penghua",20045;537,*p[5],*t;
int i,j;
for(i=0;i<5;i++)p[i]=&s[i];
for(i=0;i<4;i++)
for(j=i+1;j<5;j++)
if(p[i]->Score>p[j]->Score)
t=p[i];p[i]=p[j];p[i]=t;
printf("%d%d\n",s[1].Score,p[1]->Score);

执行后输出结果是

A.550550

B.680680

C.580550

D.580680

答案

参考答案:C

解析:本题中首先定义了结构体类型STU,该结构体由一个长度为10的字符数组、两个整型变量num和Score组成。在主函数中,定义了一个长度为5的结构体数组s并赋初值,一个指针数组p和一个指针变量t,接着将数组s中各元素的地址依次赋给指针数组p中的各成员。然后通过两个for循环将数组p按Score的值从小到大的顺序排列。因此最后输出的p[1]->Score的值为550,而数组s[1].Score的值为580。

阅读理解

The mystery stories of Sir Arthur Conan Doyle are famous all over the world.

The detective in his stories is called Sherlock Holmes. He solves mysteries in a most surprising way. His assistant, Dr Watson, watches with admiration and then writes up the story of the mystery afterwards.

This is a useful story writing skill. Because Watson is not very clever, the story remains a mystery until the end. The readers can sometimes pick up some clues before he does! Then, to make Watson understand the mystery, Holmes has to explain it all, step by step. So we, the readers, get to see it step by step too. Watson is almost as good a character in the story as Sherlock Holmes!

The very first time they meet, Holmes greatly surprises Watson. When they are first introduced, Holmes says to Watson, ‘How do you do? I see you have been to Afghanistan(阿富汗).’

Watson is too amazed by this to ask Holmes how he knows this. Watson has, indeed, been to Afghanistan. Later, he asks Holmes about it. Holmes explains that there is nothing magical about what he does. He gets to know it all by very, very careful observation(观察).

Observation One

Watson was introduced to Holmes as a doctor. Yet Holmes thought that the way he stood and walked made him seem like a soldier. So, this meant he was probably an army doctor.

Observation Two

Watson's face was quite dark skinned. But his wrists were pale. So his dark face was probably sun burnt. This meant that he had been to a hot, sunny country.

Observation Three

At the time, the British army had soldiers at bases in many parts of the world. So there were still a lot of places to choose from. However, Holmes saw that Watson looked very tired and he was always holding his left arm, as if it was painful. So, he had probably been with the army to a place where they were fighting. There was only one place where the British army was fighting at that time: Afghanistan.

小题1:The writer most probably created the character, Dr Watson, to ______.

A.give Holmes help when solving mysteries

B.show Holmes' careful observation

C.help readers pick up some clues about the mystery

D.get readers to see the mystery step by step小题2: The first time they meet, ______.

A.Holmes explains how he knows Watson has been to Afghanistan

B.Holmes surprises Watson by telling that he has been to Afghanistan

C.Watson tells Holmes he has been to Afghanistan

D.Watson asks Holmes how he knows he has been to Afghanistan小题3:From the passage we know that the British army ______ at that time.

A.only had soldiers in Afghanistan

B.had many army doctors at bases in many parts of the world

C.was fighting with several countries

D.was fighting with Afghanistan

配伍题