问题 填空题

有以下语句段
int n1=10,n2=20;
printf(" 【7】 ",n1,n2);
要求按以下格式输出n1和n2的值,每个输出行从第一列开始,请填空。
n1=10
n2=20

答案

参考答案:n1=%d\nn2=%d\n或n1=%d\nn2=%d或n1=%2d\nn2=%2d\n或n1=%2d\nn2=%2d

解析: printf函数有两种参数,格式控制参数和输出项参数。其中格式控制参数由两种成分组成:格式说明和普通字符,普通字符将被简单地复制显示,格式说明项将引起一个输出参数项的转换与显示,它是由%引出并以一个类型描述符结束的字符串。本题中,n1=和n2=就是普通字符,可以直接输出,因为n1,n2为整数,所以格式说明项为%d,在每行输出结束时加转义字符\n进行换行。

单项选择题

I will never forget the year I was about twelve years old. My mother told us that we would not be (16) Christmas gifts because there was not enough money. I felt sad and thought, "What would I say when the other kids asked what I’ d (17) " Just when I started to (18) that there would not be a Christmas that year, three women (19) at our house with gifts for all of us. For me they brought a doll. I felt such a sense of (20) that I would no longer have to be embarrassed when I returned to school. I wasn’t (21) . Somebody had thought (22) of me to bring me a gift.

Years later, when I stood in the kitchen of my new house, thinking how I wanted to make my (23) Christmas there special and memorable, I (24) remembered the women’s visit. I decided that I wanted to create that same feeling of (25) for as many children as I could possibly reach.

So I (26) a plan and gathered forty people from my company to help. We gathered about 125 orphans (孤儿) at the Christmas party. For every child, we wrapped colorful packages filled with

toys, clothes, and school supplies, (27) with a child’ s name. We wanted all of them to know they were (28) Before I called out their names and handed them their gifts, I (29) them that they couldn’t open their presents (30) every child had come forward. Finally the (31) they had been waiting for came as I called out, "One, two, three. Open your presents!" As the children opened their packages, their faces beamed and their bright smiles (32) up the room. The (33) in the room was obvious, and (34) wasn’ t just about toys. It was a feeling, and the feeling I knew (35) that Christmas so long ago when the women came to visit. I wasn’t forgotten. Somebody thought of me. I matter.

33().

A. atmosphere

B. sympathy

C. calmness

D. joy

单项选择题 A1/A2型题