问题 填空题

[说明]
基于管理的需要,每本正式出版的图书都有一个ISBN号。例如,某图书的ISBN号为“978-7-5606-2348-1”。
ISBN号由13位数字组成:前三位数字代表该出版物是图书(前缀号),中间的9个数字分为三组,分别表示组号、出版者号和书名号,最后一个数字是校验码。其中,前缀号由国际EAN提供,已经采用的前缀号为978和979;组号用以区别出版者国家、地区或者语言区,其长度可为1~5位;出版者号为各出版者的代码,其长度与出版者的计划出书量直接相关;书名号代表该出版者该出版物的特定版次;校验码采用模10加权的算法计算得出。
校验码的计算方法如下:
第一步:前12位数字中的奇数位数字用l相乘,偶数位数字用3相乘(位编号从左到右依次为13到2)。
第二步:将各乘积相加,求出总和S。
第三步:将总和S除以10,得出余数R。
第四步:将10减去余数R后即为校验码V。若相减后的数值为10,则校验码为0。
例如,对于ISBN号“978-7-5606-2348-1”,其校验码为1,计算过程为:
S=9×1+7×3+8×1+7×3+5×1+6×3+0×1+6×3+2×1+3×3+4×1+8×3=139
R=139mod 10=9
V=10-9=1
函数check(char code[])用来检查保存在code中的一个ISBN号的校验码是否正确,
若正确则返回true,否则返回false。例如,ISBN号“978-7-5606-2348-1”在code中的
存储布局如表3-1所示(书号的各组成部分之间用“-”分隔):
                    

表3-1 数组code的内容示例

下标 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
字符 9 7 8 - 7 - 5 6 O 6 - 2 3 4 8 - 1 \\0

在函数check(char code[])中,先将13位ISBN号放在整型数组元素tarr[0]~tarr[12]中(如表3-2所示,对应ISBN号的位13~位1),由tarr[0]~tarr[11]计算出校验码放入变量V,再进行判断。

表3-2 数组tarr的内容示例

下标 0 l 2 3 4 5 6 7 8 9 10 11 12
字符 9 7 8 7 5 6 0 6 2 3 4 8 1
[C函数]
boo1 cheCk(char code[])

int i,k=0;
intS=0,temp=0;
int V;
int tarr[13]=0;
if (Strlen(code) <17 return falSe;
for(i=0; i<17; i++)/*将13位ISBN号存入tarr*/
if(code[i]!=’-’)
tarr[ (1) ]=code[i]-’0’;
for(i=0; (2) ; i++ );
if (i%2)
S+= (3) ;
else
S+= (4) ;

v=( (5) ==C) 0:10-s%10;
if(tart[12]==v)
return true ;
return false;


答案

参考答案:i<12,或i<k-1(空(1)处填k++),或i<temp-l(空(1)处填temp++),或等价形式

阅读理解

Think about the different ways that people use the wind. You can use it to fly a kite or to sail a boat. Wind is one of our cleanest and richest power sources, as well as one of the oldest. Evidence shows that windmills(风车) began to be used in ancient Iran back in the seventh century BC. They were first introduced to Europe during the 1100s, when armies returned from the Middle East with knowledge of using wind power.

For many centuries, people used windmills to grind(碾碎) wheat into flour or pump water from deep underground. When electricity was discovered in the late 1800s, people living in remote areas began to use them to produce electricity. This allowed them to have electric lights and radios. However, by the 1940s when electricity was available to people in almost all areas of the United States, windmills were rarely used.

During the 1970s, people started becoming concerned about the pollution that is created when coal and gas are burned to produce electricity. People also realized that the supply of coal and gas would not last forever. Then, wind was rediscovered, though it means higher cost. Today, there is a global movement to supply more and more of our electricity through the use of wind.

小题1:From the text we know that windmills________.

A.were invented by European armies

B.have a history of more than 2,800 years

C.used to supply power to radio in remote areas

D.have rarely been used since electricity was discovered小题2:What was a new use for wind power in the late 19th century?

A.Sailing a boat.

B.Producing electricity.

C.Grinding wheat into flour.

D.Pumping water from underground.小题3:One of the reasons wind was rediscovered in the 1970s is that_______.

A.wind power is cleaner

B.it is one of the oldest power sources.

C.it was cheaper to create energy from wind

D.the supply of coal and gas failed to meet needs小题4:What would the author probably discuss in the paragraph that follows?

A.The advantages of wind power.

B.The design of wind power plants.

C.The worldwide movement to save energy.

D.The global trend towards producing power from wind.

单项选择题