问题 单项选择题

对于语句cout<<setfill(‘*’)<<setw(10)<<1<<setfill(‘*’)<<setw(2) <<2;的输出结果是

A.* * * * * * * * *1 *2

B.* * * * * * * *12

C.* * * * * * *1 *2

D.12* * * * * * * *

答案

参考答案:A

解析: C++语言中setfill的意思是在空格的地方填上setfill函数中的参数字符,setw的意思是设置整个输出字符串的字符个数,本题中用。宋代替空格。

阅读理解

I have made a time machine. It can take people to the past or the future for five hours. I thought that it would be fun to see what my father was like when he was 10 years old.

I got into my time machine and keyed in the words, “1981, 11 Niven Road, New York ” then pressed the button … In a moment, I was in front of a house, 11 Niven Road.

I saw four children looking for a lost dog. They were my father, my uncle Tom, my aunts Peek and Janet. I went up to them and helped them look for their dog, Jack.

We wanted to climb a hill and looked for Jack. When we reached the top, we heard a dog barking. “Jack!” my father shouted . Then we saw Jack was standing in front of a man.

We asked the man to return Jack to us. The man had to give Jack back to us.

Happily, We went back to 11 Niven Road and I said goodbye to them . My five hours were almost up. I ran to the machine and soon I was back in my time . What an unusual experience!

小题1: Which of the following is TRUE ?

A. The time machine can take people to the past or the future for five hours.

B. I wanted to see what my father was like ten years ago.

C. I couldn’t see what my father was like ten years ago.

小题2: When was my father born ?

A. In 1971.

B. In 1981.

C. In 1991.

小题3: Why did we climb to the top of the hill ?

A. Because we wanted to play games there .

B. Because we wanted to look for the dog .

C. Because we wanted to look for the man .

小题4: How long did I travel to the past ?

A. 10 hours

B. 5 hours

C. 2 hours

小题5: Which is the best title ?

A. An unusual experience

B. A lovely dog called Jack

C. An experience to the future

名词解释