问题 单项选择题

下列程序的输出结果是( )。# include < iostream.h>int min( int a,int b){if(a < b)return a;else return b;return 0}void main ( ) {cout << min(1,min(2,3)) << endl;}

A.15

B.25

C.35

D.45

答案

参考答案:C

解析:在调用过程时,一般主调与被调过程之间有数据传递,即将主调过程的 实参传递给被调用的过程,完成实参与形参的结合,然后执行被调过程,在Visual Basic 中,实参与形参的结合有两种方式:即传址与传值。这两种方法的特点如下: 传址的结合过程是,当调用一个过程是,它将实参的地址传给形参,在被调用的过程 中,对形参的任何操作都变成了对相应实参的操作,因此实参的值会随形参的改变而改变。 传值的结合过程是,当调用一个过程时,系统将实参的值赋值给形参并断开了联系, 被调用过程中的操作时在形参自己的存储单元中进行的,当过程调用结束时,这些形参 所占用的存储单元也同时被释放,因此在过程中对形参的任何操作不会影响实参。而题 中被调过程Proc中有两个形参,其中第一个形参n为传址方式,第二个形参m为传值方 式。主调过程分别把实参x、y传递给Proc,所以当过程调用结束后,实参x的值应随着被 调过程变化而变化,而实参y值在主调函数中始终不变,所以输出y的值仍为29;在被调 过程中 "n = n Mod l0 "被调用时,相当于“x=x Mod l0”,所以x的值最终为6。

阅读理解

     Jack sits in the coffee bar that looks at Jaffa Street listening to the sad, sad music playing on an old

tape recorder. "Oum Khalsoum", says one of the other men sitting in the coffee bar to nobody in

particular. "This is Oum Khalsoum singing".

Jack takes another sip of sweet mint(薄荷) tea and nods in agreement without saying anything. His uncle

lives in Egypt, and every time he visits him, he tells him the story of how he saw the well-known singer at

one of her concerts in Cairo in 1970, not long before she died. The song seems to go on forever, and it's

very sad. He thinks it's beautiful, but he doesn't want to hear it now. It's too sad for him. It makes him

think of his uncle in Egypt who he hasn't seen for many years now, and also about the reason why his

uncle lives in Egypt while his aunt lived in Lebanon and why he, on the other hand, lives in Jordan, and

why he is in Jerusalem now.

     His father died a few months ago. After that, he found that there were so many things that he had

wanted to ask his father, but had never asked . He realized that he knew very little about his own family,

and decided to try and find out more about the place where his father had grown up, and where his

grandparents (who had died when he was very young) were from.

     He has now spent a couple of days wandering around Jerusalem with an old, torn photograph in his

hand. The photograph shows the whole family, his grandparents standing proudly at the centre of a

group of four children in front of a house on a busy street. Next to the house there seems to be a garden

with what look like olive (橄榄色) trees in it.

     Jack, though, can't find anywhere in this modern Jerusalem that looks much like the street or the

house where the photograph was taken. He feels sadder than the sad song playing in the cafe, thinking

now that he might never find the place where his father had been born and the place where his

grandparents had lived until they moved away in 1947.

1. According to the passage, the sad music make Jack think of _____.

A. His uncle

B. His father

C. His mother

D. His family

2. We can know that Jack used to live______.

A. in Egypt

B. in Jerusalem

C. in Jordan

D. in Cairo

3. Jack tried to find out that_____.

A. Where his father lived in the past

B. Where his grandparents was from

C. He wanted to know more about his family

D. All of above

4. It is implied that______.

A. Jack wants his family to lead a good life

B. Jack has a photograph taken with his family

C. Jack looks happy and enjoys love from his family

D. Jack is a lonely man and knows little about his father

多项选择题