问题 填空题

下面fun函数的功能是将形参x的值转换成二进制数,所得二进制数的每一位数放在数组中返回,二进制数的最低位放在下标为0的元素中,其他依此类推。请填空。
Fun(int x,int b[])
int k=0,r;
do
r=x%2;
______=r;
x/=2;
while(x);

答案

参考答案:b[k++]

解析: 本题的考查点是do-while语句。
形参x默认为十进制,要想将一个十进制的数转换成二进制,可以使用整除求余法,题中的程序段也表明了将使用这种方法,将一个十进制的数转换成二进制要用这个十进制数不断的整除2,将每次的余数记录下来,直至无法再除,此时,整除得到的第一个元素即为二进制数的最低位,其余依次类推,所以在程序段中的横线处,应当填写“b[k++]”。

单项选择题

I was a single parent of four small children, working at a low paid job. Money was always tight, but we had a (1) over our heads, food on the table, clothes on our backs, and if not a lot, always (2) . Not knowing we were poor, my kids just thought I was (3) . I’ve always been glad about that.
It was Christmas time, and although there wasn’t (4) for a lot of gifts, we planned to celebrate with a family party. But the big (5) for the kids was the fun of Christmas (6) .
They planned weeks ahead of time, asking (7) what they wanted for Christmas. Fortunately, I had saved MYM120 for (8) to share by all five of us.
The big (9) arrived. I gave each kid a twenty-dollar bill and (10) them to look for gifts of about four dollars each. Then everyone scattered. We had two hours to shop; then we would (11) back at the "Santa’s Workshop"
Driving home, everyone was in high Christmas spirits, (12) my younger daughter, Ginger, who was unusually (13) She had only one small, flat bag with a few candies—fiftycent candies I was so angry, but I didn’t say anything (14) we got home. I called her into my bedroom and closed the door, (15) to be angry again. This is what she told me.
"I was looking (16) thinking of what to buy, and I (17) to read the little cards on the ’Giving Trees’. One was for a little girl, four years old, and all she (18) for Christmas was a doll. So I took the card off the tree and (19) the doll for her. We have so much and she doesn’t have anything. "
I never felt so (20) as I did that day.

二、完形填空

A.little

B.less

C.enough

D.more

问答题 案例分析题