问题 单项选择题

有以下程序: void f(int b[]) {int i; for(i=2;i<6;i++)b[i]*=2; } main() {int a[10]={1,2,3,4,5,6,7,8,9,10},i; f(a); for(i=0;i<10;i++)printf("%d,",a[i]); } 程序运行后的输出结果是______。

A.1,2,3,4,5,6,7,8,9,10,

B.1,2,6,8,10,12,7,8,9,10

C.1,2,3,4,10,12,14,16,9,10,

D.1,2,6,8,10,12,14,16,9,10,

答案

参考答案:B

解析: 本题在调用函数时,实参是数组名也是把数组a的首地址传递给形参,由条件i=2且i<6得出函数将列以a[2]开始的4个元素(3、4、5、6)进行乘2操作,结果分别是a[2]=6、a[3]=8、a[4]=10、a[5]=12。a[0]、a[1]、a[6]、a[7]、a[8]、a[9]的值没有发生变化。

阅读理解

As a young child, I was quiet and shy. I was also sick for a long time. My parents worked, and I spent a lot of time at my grandparent’s home. While my grandmother cleaned the house and cooked, my grandfather played with me.

I was six when my grandfather died. A few months before he died, he gave me a beautiful blue and white blanket (毯子). I loved the blanket very much because it made me think of my grandfather. But after a few years, the blanket didn’t look very good. It had holes and was dirty. I didn’t want to throw the blanket away, so my mother made the blanket into a book bag. I was proud of the book bag, and I used it to carry my books to school every day for a few years. Then the book bag was broken. I begged my mother to make something out of it. She made it into a pencil-box. After a few months, the pencil-box was broken, too. By then I could sew (缝), and I made the pencil-box into a small wallet.

I used it for three years, but one day I lost it. I felt sad. My friends and family said, “Forget about it, Paul. You can’t make something out of nothing.”

I thought about it for a while. I decided my friends and family were wrong. There was a way to make something out of nothing. I wrote down the story of my grandfather’s blanket.

小题1:From the story, we know that             .

A.Paul’s grandfather gave him a blanket

B.the blanket made Paul think of his mother

C.a few years later the blanket was still new

D.Paul’s grandfather died when Paul was ten小题2:Paul used the pencil-box for ________.

A.a few months

B.two weeks

C.three years

D.five years小题3:Paul felt sad when he lost ________ one day.

A.the blanket

B.the book bag

C.the wallet

D.the pencil-box小题4:Paul wrote down the story to ____________.

A.pass the time

B.find the blanket

C.tell his grandfather

D.remember his grandfather

判断题