问题 单项选择题

在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。
Private Function fun(x As Integer,y As Integer)
Static m As Integer
Static i As Integer
i=i+2
i=i+m+1
m=i+x+y
fun=m
End Function
Private Sub Command1_Click()
Dim j As Integer,m As Integer,k As Integer
j=4:m=1
k=fun(j,m)
Print k;
k=fun (j,m)
Print k
End Sub

A.8 18

B.7 17

C.7 19

D.8 19

答案

参考答案:D

解析: 当发生Command1的单击事件时,定义了两个变量j和m,并依次赋值为4和1,然后调用fun函数,把i和m按地址传递给x和y,进入fun函数执行。在 fun函数中定义了两个静态变量m和i,执行三条赋值语句后i的值为3,m的值为8,通过给函数名赋值把8作为函数值返回并赋值给k,输出k的值为8;再一次调用函数fun,把j和m依次按地址传给x和y,进入fun函数执行,注意,由于m和i是静态变量,此时的值不再是0,而是上一次退出时的值为3和8。执行三条赋值语句后i的值为14,m的值为19,通过给函数名赋值,把19作为函数值返回并赋值给k,输出k的值为19。

完形填空
完形填空
When I was in Grade Three, I was chosen to the heroine in the school play.
For weeks my mother helped me  1  my lines(台词), But once on stage.  Every word disappeared   2  my head.  My teacher asked me to change   3 and be the narrator.
Although I didn’t tell my mother  4 had happened that day, she   5 my unhappiness and asked if I wanted to take a walk in the yard.
It was a lovely  6 day.  It was warm.  In the yard all the flowers came out.  We could see lots of dandelions dancing among the colorful flowers.  How beautiful they were! I watched my mother carelessly bend down by some flowers.  “I think I am going to   7 all the useless grass. ” She said.
“But I like dandelions,” I said, “All flowers are   8  — even dandelions”.
My mother looked at me   9 .  “Yes, every flower shines in its own way, doesn’t it?” she said.  I nodded.  “So that is  10  of people, too. ” She added.
She had guessed my   11 .  I started to cry and told her the truth.
“You will be a great narrator. ” She said.  Then she told me   12 I loved to read stories to her when I was in Grade 1.
Over the next few   13 I learned to take pride in the role.  The big day finally   14 .  A few minutes before the play, my teacher came over to me.  “Your mother asked me to give this to you,” she said, passing me a dandelion.  After the play, I took the flower home, laughing that I was perhaps   15 person who would keep such a common dandelion.
小题1:
A.writeB.practiceC.trainD.provide
小题2:
A.fromB.inC.onD.over
小题3:
A.namesB.characterC.rolesD.lines
小题4:
A.whichB.whenC.thatD.what
小题5:
A.sensedB.touchedC.reachedD.heard
小题6:
A.springB.summerC.autumnD.winter
小题7:
A.use upB.eat upC.dig upD.drink up
小题8:
A.perfectB.livelyC.attractiveD.natural
小题9:
A.sadlyB.carelesslyC.surprisinglyD.happily
小题10:
A.kindB.goodC.trueD.suitable
小题11:
A.worryB.stressC.nervousnessD.pain
小题12:
A.howB.how muchC.how manyD.how long
小题13:
A.daysB.weeksC.monthsD.years
小题14:
A.wentB.cameC.ranD.appeared
小题15:
A.the onlyB.the bestC.the lastD.the worst
解答题