问题 填空题

下面程序的功能是输出数组s中最大元素的下标,请填空。 main() { int k,p,s[]={1,-9,7,2,-10,3}; for(p=0,k=p;p<6;p++) if(s[p]>s[k])______ printf("%d\n",k);}

答案

参考答案:k=p;

解析: 为寻找数组中最大元素的下标,需先预设1个临时最大元素的下标,并顺序逐一考查数组的元素,当发现当前元素比临时最大元素更大时,就用当前元素的下标更新临时最大元素下标。直至考查了数组的全部元素后,这临时最大元素下标就是数组的最大元素下标。通常预设的最大元素下标是数组的首元素下标,考查通常从首元素开始顺序向后继元素考查。程序中,存储临时最大元素下标的变量是k,变量p控制顺序考查的循环控制变量。当发现当前元素s[p]比临时最大元素s[k]更大时,应该用p更新k,所以在空框处应填入代码“k=p;”。

阅读理解

阅读短文,然后根据要求完成任务。

   Do you carry too much on the way to school or home? Don’t worry.Try e-readers (电子阅读器) and say goodbye to your heavy schoolbag.

An e-reader has the memory space to hold hundreds of books.So people want to (A)扔掉沉书包 and read with small, light e-readers.For example,Cushing Academy,a high school in Massachusetts,USA,replaced (替换) most of the 20,000 books in (B) its library last summer.Teachers and students will use e-readers instead.

Most e-readers are thin and weigh less than 500g.They can download (下载) an e-book in 60 seconds.“It’s (C) so easy.You can have a lot of books right at your fingers!” said Meghan Chensusky.

Chinese schoolchildren are also trying e-readers.At the Shanghai World Expo (世博会),an e-schoolbag is now on show.It is a special e-reader.Students can use it to download textbooks from the school servers (服务器).(D)It can also send and receive homework.Some Schools in Beijing and Shanghai have tried this e-schoolbag for a few years.“It’s excellent.I (E)don’t have to carry a heaw schoolbag anymore,”said Xiao Qi,15,Beijing.

New e-readers are not just for reading.They have Wi-Fi and multimedia (无线电视和多媒体).Parents worry that these may hurt their children’s study habits. “I think Wi-Fi is not necessary for kids,”said Zeng Wenwen,43, Beijing.

小题1:将文中划线部分(A)译成英语:________________

小题2:文中划线部分(B)指代的是:________________

小题3:写出文中划线部分(C)和(E)的同义词或近义词:________ ________

小题4:将文中划线部分(D)改写为:Homework can also__________  _________and received through it.

小题5:从文中找出两个修饰或描写e-reader的形容词:________ ________

名词解释