问题 填空题

设有二维数组A[0..9,0..19],其每个元素占两个字节,数组按列优先顺序存储,第一个元素的存储地址为100,那么元素A[6,6]的存储地址为 【5】

答案

参考答案:232

解析:[评析] 对于按行优先顺序存储的二维数组A[m][n],若其首地址是S,每个元素占k个字节,则数组元素A[i][j]的地址p是p=S+(i×n+j)×k按列优先顺序存储时,则有:
p=S+(j×m+i)×k
(这里说的数组下标都是从0起始的)套用第2个公式:
p=100+(6×10+6)×2=232。

阅读理解

阅读理解

     Once there was a boy. He loved sweets very much. He always asked his father for sweets.

     The boy's father thought hard about how to stop the child from asking for so many sweets. A great man lived

nearby. The boy's father decided to take the boy to him. He might be able to make the child give up sweets.

     So they went to the great man. The father asked the great man to help him. But the great man liked sweets himself.

He told the father to bring his son back after a month.

     During the month, the great man tried to give up eating sweets. At last he did it. When the boy and his father

returned after a month, the great man had a talk with the boy. From then on, the boy did not ask for sweets any more.

     The boy's father felt surprised, "Why didn't you ask my son to give up sweets when we came to you a month ago?"

The man answered, "How could I ask a boy to give up sweets when I loved sweets myself?" In the last month I gave

up eating sweets."

     A person's example is always stronger than words. We should not ask others to do what we can't do ourselves.

1. The boy's father took his son to the great man because __________.

A. the man lived close to the house.

B. the man might give him some help.

C. the man was also fond of sweets.

D. the man had already given up sweets.

2. Which of the following is NOT TRUE?

A. The great man had a hobby of eating sweets.

B. The great man gave up eating sweets in a month.

C. The father and son came back to the man a month later.

D. The boy failed to stop eating sweets at last.

3. Which is the best title for the passage?

A. Eating sweets is bad for children.

B. A good way to give up eating sweets.

C. Giving up sweets is not difficult.

D. Examples speak louder than words.

口语交际,情景问答题