问题 填空题

以下程序的输出结果是 【10】 。 #include<iostream.h> unsigned fun (unsigned num) {unsigned k=1;do{k*=num%10;num/=10;} while(num);return k; } void main( ) { unsigned n=26;cout <<fun(n) <<end1; }

答案

参考答案:L

解析: 函数有一个形参num,循环前变量k置1,循环中,表达式num%10是取num的个位,将num的个位值累乘于k中,然后num除以10。循环直至num为0结束,这是逐一求出num十进制表示的各位数字,并累乘于变量k的循环。函数最后返回k。函数fun的功能是求整数的各位十进数字积。

阅读理解

阅读理解

     All over my garden I've planted nothing but roses, because I especially love the flower. A close

friend came for a visit the other day. I told her that she should pick a bunch of roses to beautify her

bedroom. I promised that the smell of the roses would be wafted far, far away.

     That girl friend of mine, walking into the garden in high spirits, smelt here and there, but in the end

she didn't pick a single rose. I said that she could pick many flowers; I told her that I was not a flower

farmer and didn't make a living out of them. Saying so, I raised the scissors for the sacrifice of the

flowers, but she stopped me, crying no, no, no!

     To cut such beautiful roses would hurt one, she said. With her hands seizing at my sleeves, she told

me that by no means should they be cut. Roses are the smiling face of the earth, and who could be so

ironhearted as to destroy such a charming smile?

     My mind was shocked: the ugly earth, the tough earth, the plain earth-it is for the reason of that smile

that it wins the care and pity of people.

1. The writer plants nothing but roses in her garden probably because ________.

A. she can make money out of them

B. her friends like them

C. she enjoys the roses very much

D. the roses sell well

2. The underlined word "wafted" in Paragraph 1 is closest in meaning to "________".

A. given off  

B. lost

C. destroyed  

D. thrown away

3. Why did the writer's close friend refuse to pick a single rose?

A. Because the roses were not beautiful.

B. Because she loved the roses very much.

C. Because she did not like this kind of roses.

D. Because the writer did not want to give her any.

4. What is the best title for the passage?

A. The Pity of People to the Roses

B. A Lover of Flowers

C. A Lovely Rose Garden

D. The Smiling Face of the Earth

单项选择题