问题 单项选择题

设有定义:int a;float b;执行scanf("%2d%f",&a,&b);语句时,若从键盘输入876543.0<回车>,a和b的值分别是【 】。

A.876和543.000000

B.87和6.000000

C.87和543.000000

D.76和543.000000

答案

参考答案:B

解析:本题考查了scanf的附加格式说明字符,输入格式符%2d%f表示a输入的值为2列的十进制整数,即87,然后将紧接着的6赋给b,因为b的值为单精度数6,即6.000000,故本题的答案为选项B)。

阅读理解

阅读理解。

      Peter wanted very much to be a soldier when he was a child. So he joined the army (军队) when

he was eighteen, and for several months he was taught how to be a good soldier. He did quite well in

everything except shooting. One day he and his friends were practicing their shooting (射击), and all

of them were doing quite well except Peter. After he had shot at the target (靶) nine times and hadn't

hit it once, the officer who was trying to teach the young soldiers to shoot said, "You are quite hopeless,

Peter. I don't waste your last bullet! Go behind that wall and shoot yourself with it!"

       Peter felt ashamed (难为情). He went behind the wall and a few seconds later, the officer and the

other soldiers heard the sound of a shot.

       "Oh, dear!" the officer said. "Has that silly man really shot himself?" He ran behind the wall as quickly

as he could, but Peter was all right."I'm sorry, sir," he said, "but I missed again."

1. Peter joined the army in order to ______?

A. be a soldier

B. be good at shooting

C. make friends

D. get a good job

2. The officer thought Peter was hopeless because ______.

A. he didn't know how to use a gun.

B. he didn't get along well with other soldier.

C. he was poor at shooting.

D. he couldn't do anything well.

3. What the officer said at the end of the first paragraph(段落) shows that ______.

A. the officer really wanted Peter to die

B. the officer was very angry with Peter

C. the officer was not a kind-hearted man

D. the officer was afraid that Peter would shoot himself

4. The officer felt ______ when he heard the sound of a shot.

A. ashamed

B. frightened

C. excited

D. disappointed (失望)

5. What happened at the end of the story?

A. Peter became a good soldier.

B. Peter killed himself behind the wall.

C. The officer was pleased with Peter in the end.

D. Peter missed the target for the tenth time.

单项选择题