问题 填空题

有如下程序:
Private Sub command1_Click()
  a=1:b=1
  Print"a=";a;",b=";b
  Call mult((a),b)
  Print"a=";a;";b=";b 语句
End Sub
Sub mult(x,y)
  x=2*k
  y=3*k
  Print"x=";x;",y=";y
End Sub
运行后,标有“语句”的Print语句的输出结果是______。

答案

参考答案:a=1,b=3

解析:[命题目的] 考查考生对参数传递的掌握情况。
[解题要点] 在Visual Basic语言中,虚实结合有值传递方式和地址传递方式,实参为常量或表达式,是值传递方式,这种传递是单向的。实参为变量,是地址传递方式,这种传递是双向的,在调用子程序时,形参的值如果改变了,会通过实参带回主程序。本题中,第1个实参变量a用括弧括起来,采用的是值传递方式;第2个实参数变量b没用括弧括起来,采用的是地址传递方式。在调用子程序后,第1个实参a的值为1,不管在子程序中是否被重新赋值,返回调用程序,保留调用前的值仍为1;第2个实参数b的值为1,在子程序中被重新赋值为3,返回调用程序就不再保留调用前的值,而是带回了形参的值3。因此,在标有“语句”的Print语句中的输出项为a=1,b=3。
[错解分析] 参数的传值方式和传址方式的区别。
[考点链接] 函数调用和参数传递。

单项选择题 A1/A2型题
阅读理解

Two thieves came to a house to steal something. They dug a hole in the wall of the house.

  There lived many mice in the house. The woman in the moonlight saw a mouse crawl(爬行) into the house. “Look! In comes one,” she said to the man in the house. The thief was so frightened that he hurriedly crawled out of the house and said to the one waiting outside, “She found me when I was just in.” But the thief outside didn’t believe him, so he said, “Let us try to crawl into the house together.” At that time two mice happened to crawl into the house, too. The woman saw the mice and shouted, “In come two, catch them!” The two thieves were terribly frightened. The man in the house said, “You saw them come in but where are they? I will catch them tonight.” The two thieves started running away at once.

  The two thieves wanted to make it clear whether they had been found or not the night before. The next day they acted as men selling sweet potatoes and came before the house. The man and the woman were ploughing in their fields. The rope broke and the woman came home for a rope. She saw two men selling sweet potatoes and wanted to buy some. She picked out two which looked like mice. At the time the man couldn’t wait for her any longer in the fields and he ran back from the fields to hurry her up. The woman showed the sweet potatoes to the man and said, “How they look like the two of last night.” The man said, “I asked you to fetch a rope, why don’t you hurry for it?” The two thieves ran away very quickly without their sweet potatoes.

小题1:The two thieves failed to steal anything from the house because _____.

A.they were found out

B.they were frightened by what they had heard in the house

C.they didn’t work together well with each other

D.mice stopped them from doing so小题2:From the last paragraph, we know that _____.

A.the two thieves were famous selling sweet potatoes

B.the woman recognized the two thieves

C.the woman pretended to know nothing about the two thieves and made fun of them

D.the two thieves didn’t know that they were not found at all小题3:When the woman said, “How they look like the two of last night,” _____.

A.she referred to the two thieves

B.she meant nothing

C.she said it on purpose

D.she referred to the mice小题4:The best title for the passage may be ____.

A.Two Clever Thieves

B.Terrible Mice

C.Hit the Mark by a Fluke

D.A Clever Couple