问题 单项选择题

有以下程序
int f (int

A.
return a%2;
main ( )
int s[8]=1,3,5,2,4,6),i,d=0;
for (i=0; f(s[i]; i++) d +=s[i];
print f ("%d\n",D) ;

程序运行后的输出结果是A) 9

B.11

C.19

D.21

答案

参考答案:A

解析: 本题考核的知识点是一维数组的定义,初始化和数组中元素的引用。函数f()的作用是形参a为偶数的时候返回0,主函数中首先定义了一个长度为8的一维数组,然后给它赋初值使得s[0]=1、a[1]=3、s[2]=5、s[3]=2、s[4]=4、 s[5]=6.其他没有赋值的数组元素将自动赋值为0。 for循环中,当s[1]不为偶数的时,将s[i]相加,即当 i=3时,s[i]=2为偶数,退出循环,此时d的值为 d=s101+s[1]+s[2]=1+3+5=9,因此最后输出的d的值为9。所以,4个选项中选项A符合题意。

完形填空
No family wants its home to catch fire, but it's good to plan for a fire just in case (以防万一). Talk with your family about  36 to do if a fire starts.   37  should have a plan for getting out of the house. Be sure to choose a safe place to   38  after everyone gets away from the fire.
What should you do   39  there is a fire?  First,   40  people know about the fire. Yell (叫喊) the word "fire". Knock on the walls with your hands.
Then   41  the door of your room. If the door is warm, don't open it. If it's cool, open it just enough to  42 . If you see fire or much smoke, close the door fast.
If you can't see fire or smoke, you can go out of the door. Shut the  43  behind you. That will slow down the fire. Now find a   44 out. Stay away from the smoke. The air is the  45  near the floor. So it   46  be the safest to crawl(爬)when you leave the house.
If you can't leave your room,  close your door. Cover the crack (缝隙) under the door
  47   clothing. Then open the window or   48  the glass with a chair. Crawl out, of the window   49 .If the window is high off the ground,   50 jump! Wave a towel out of the window, and yell for help. When you get out of the house, run to the place where you and your family chose to meet.
小题1:
A.how B.whenC.whatD.where
小题2:
A.Everyone B.SomeoneC.AnyoneD.No one
小题3:
A.visit B.sleepC.standD.meet
小题4:
A.unlessB.ifC.becauseD.as
小题5:
A.letB.teachC.wantD.ask
小题6:
A.lookB.hearC.feelD.smell
小题7:
A.put outB.find outC.look outD.take out
小题8:
A.windowB.doorC.houseD.room
小题9:
A.wayB.tripC.timeD.plan
小题10:
A.bestB.worstC.thinnestD.least
小题11:
A.shouldB.needC.may D.has to
小题12:
A.byB.inC.of D.with
小题13:
A.cleanB.washC.breakD.make
小题14:
A.happilyB.loudlyC.excitedlyD.carefully
小题15:
A.can'tB.don'tC.notD.no
多项选择题