问题 填空题

有以下程序:
#include <stdio.h>
main()

char c;
while((c=getchar())!=’’) putchar(--c);

程序运行时,如查从键盘输入:YN<回车>,则输出的结果为______。

答案

参考答案:x

解析: 本题考查的知识点是 while循环的程序分析;主函数中首先定义了一个字符型变量C,接着执行下面while语句,在while循环中,首先从键盘上读入一个字符Y并给赋给字符变量C,赋值表达式的值不为’’,执行输出语句,输出字符x。接着判断while中的循环条件,读入一个字符’’,并赋值给c,赋值表达式的值为’’,循环条件不再满足,退出循环。

选择题
阅读理解

Compassion is a desire within us to help others. With effort, we can translate compassion into action. An experience last weekend showed me this is true, I work part-time in a supermarket across from a building for the elderly. These old people are our main customers, and it’s not hard to lose patience over their slowness. But last Sunday, one aged gentleman appeared to teach me a valuable lesson. This untidy man walked up to my register(收款机)with a box of biscuits. He said he was out of cash, had just moved into his room, and had nothing in his cupboards. He asked if we could let him have the food on trust. He promised to repay me the next day.

I couldn’t help staring at him, I wondered what kind of person he had been ten or twenty years before, and what he would be like if luck had gone his way. I had a hurt in my heart for this kind of human soul, all alone in the world, I told him that I was sorry, but store rules didn’t allow me to do so. I felt stupid and unkind saying this, but I valued my job.

Just then, another man, standing behind the first, spoke up. If anything, he looked more pitiable. “Charge it to me” was all he said.

What I had been feeling was pity. Pity is soft and safe and easy. Compassion, on the other hand, is caring in action. I thanked the second man but told him that was not allowed either, then I reached into my pocket and paid for the biscuits myself. I reached into my pocket because these two men had reached into my heart and taught me compassion.

小题1:The aged gentleman who wanted to buy the biscuits ________.

A.promised to obey the store rules

B.forgot to take any money with him

C.hoped to have the food first and pay later

D.could not afford anything more expensive小题2:Which of the following best describes the old gentleman?

A.Kind and lucky.

B.Poor and lonely.

C.Friendly and helpful.

D.Hurt and disappointed.小题3:The writer acted upon the store rules because ________.

A.he wanted to keep his present job

B.he felt no pity for the old gentleman

C.he considered the old man dishonest

D.he expected someone else to pay for the old man小题4:What does the writer learn from his experience?

A.wealth is more important than anything else.

B.Helping others is easier said than done.

C.experience is better gained through practice.

D.Obeying the rules means more than compassion.小题5:How would the old men feel at the end of the story?

A.Sad and disappointed.

B.Happy and lucky.

C.Depressed and unlucky.

D.Surprised and grateful.