问题 单项选择题

有以下程序:
void f(int v,int w)
int t;
t=v;V=W;W=t;

main()
int x=1,y=3,z=2;
if(x>y) f(x,y);
else if(y>z) f(y,z);
else f(x,z);
printf("%d,%d<%d\n",x,y,Z);

执行后输出结果是( )。

A.1,2,3

B.3,1,2

C.1,3,2

D.2,3,1

答案

参考答案:C

解析: C语言规定else总是和离它最近的if语句配对。分析可以知道,。函数f()作用是让形参v和形参w的值交换。在主函数中首先定义了3个变量x、y和z。然后再执行下面的if-else语句。由程序可以看出第一个else和第一个if搭配,第二个else和第二个if搭配。由于调用函数时是进行值传递的。即将实参x、y、z传给形参v和w,以后行参和实参再无联系,故通过if语句调用f()函数后,x、y和z的值并没有改变。因此最后输出的x、y和z的值为1、3和2,所以,4个选项中选项C符合题意。

阅读理解

阅读理解。

Say Goodbye

      Many people are waiting for the train. Some are reading newspapers and some are saying goodbye to their 

friends.

      Mr. Wang, Mr. Li and Mr. Chen are talking so happily that they don't know the train is going to leave. The 

guard says  to them, " Hurry up! The train is going to leave." The three men hear the guard. Two of them jump 

onto the train quickly before it moves. Mr. Wang is left behind. He looks very sad. The guard says to him, "

Don't feel sad. The next train will come in ten minutes." " I know," Mr. Wang says, " It is my train. My friends 

only come to say goodbye to me."

根据短文内容,判断句子正(T)误(F)。

( ) 1. Mr. Wang, Mr. Li and Mr. Chen are talking at the station.

( ) 2. There are only three men at the station.

( ) 3. Mr. Wang jumps onto the train. 

( ) 4. Mr. Chen and Mr. Li are Mr. Wang's friends.

( ) 5. Mr. Chen and Mr. Li really want to jump onto the train.

根据短文内容,选择正确答案。

6. _____________ people are waiting for the train.[ ]

A. Three

B. Many

C. Some

7. Some people are ______________.[ ]

A. reading books

B. cleaning the train

C. saying goodbye to their friends

8. Mr. Wang,Mr. Li and Mr. Chen are ____________ happily.[ ]

A. eating 

B. talking

C. playing

9. _____________ should jump onto the train.[ ]

A. Mr. Li 

B. Mr. Chen

C. Mr. Wang

10. Mr. Wang looks very ____________ when he sees the train move.[ ]

A. happy 

B. sad

C. angry

单项选择题