问题 单项选择题

下面程序的运行结果为( )。  #include<iostream.h>  claSS A  {    static int n;  public:    A( ){n=1;}    A(int num){n=num;}    void print( ){cout<

A. 输出的是1

B. 输出的是1和-2

C. 输出的是3和0

D. 是死循环

答案

参考答案:B

解析:本题考查函数的调用方式。函数的形参和实参具有以下特点:①形参变量只有在被调用时才分配内存单元,在调用结束时,即刻释放所分的内存单元。因此,形参只有在函数内部有效。函数调用结束返回主调函数后则不能再使用该形参变量。②实参可以是常量、变量、表达式、函数等,无论实参是何种类型的量,在进行函数调用时,它们都必须具有确定的值,以便把这些值传送给形参。因此应通过预先用赋值,输入等办法使实参获得确定值。③实参和形参在数量上,类型上,顺序上应严格一致,否则会发生“类型不匹配”的错误。④函数调用中发生的数据传送是单向的。即只能把实参的值传送给形参,而不能把形参的值反向地传送给实参。因此在函数调用过程中,形参的值发生改变,而实参中的值不会变化。注意:函数调用不可以作为一个函数的形参。

单项选择题
阅读理解

阅读理解。

     One of my favorite things I like to watch is the bloopers (洋相) and outtakes (花絮) that are shown

of mistakes made during the making of a movie. Most DVDs have a section of outtakes, and often they

will set me off laughing, especially when you know what was supposed to happen.

     We all make mistakes, and have many bloopers and outtakes in a lifetime. Some of them may be

funny like movie bloopers, a stupid mistake and we are able to laugh at ourselves. Other outtakes in life,

however, are not funny. I am referring to the tragic turns of events that happen in life that can turn our life

in a moment. Accidents, disaster, the death of a loved one happen unexpectedly, and can greatly affect

our lives. These are outtakes we would prefer not to happen or even replayed in our life.

     Times of crisis and tragedy can not be prevented, but how you handle these outtakes will affect the

rest of your life. There is always a choice in any crisis. We can choose to feel upset, but keep hopes and

move forward, or choose to become stuck in the past. We cannot choose our circumstances, but we do

have a choice how we respond to them. We can give in or overcome, and our choice will determine our

future. When we drive a car our focus is the road ahead; if we spend all our time looking in the rearview

mirror(后视镜) failure is more or less inevitable(不可避免)! The same is true in life. We will fail, or at

best remain at a standstill if we keep looking back and focusing on the events behind us, reliving the past.

1.The author mentions the outtakes of a movie in the first paragraph because         .

A. most people have the hobby of watching them

B. they are part of a movie

C. he wants to direct us to his topic in a natural way

D. he just wants to tell us a story

2. The outtakes in our life are different from those of a movie because         .

A. not all of them are funny  

B. they can be avoided

C. they are more funny        

D. they happen more often

3. The purpose of the author is to tell us         .

A. the different kinds of outtakes in real life

B. his funny experience in watching a movie

C. to choose the right attitude towards outtakes in life

D. what we should learn from the outtakes in real life

4. What would be the best title for the passage?

A. Outtakes! Give in or overcome?

B. Outtakes will destroy you.

C. There is always a choice in any crisis.

D. Keep hopes whatever happens.