问题 单项选择题

单击按钮时,以下程序运行后的输出结果是( )。  Private Sub proc1(x As Integer,y As Integer,z As Integer)    x=3*z    y=2*z    z=x+y  End Sub  Private Sub Command1_Click()    Dim x As Integer,y As Integer,Z As Integer    x=1:y=2:z=3    Call proc1(x,x,z)    Print x;x;z    Call proc1(x,y,y)    Print x;y;y  End Sub

A.6 6 12

B.9 5 10 6101051010

C.9 6 12

D.9 10 10 910155410

答案

参考答案:A

解析:从整体上看,可得主调过程将两次调用过程Proc1后,实参的值将随形参变化而变化,现在分析一下这两次调用实参和形参是怎么变化的。  第一次调用被调过程proc1,主调过程把实参x,x,z的地址分别传给形参x,y,z,此时形参x,y,z值分别为1,1,3,执行语句x=3*z后,形参x值变为9,此时相对应的实参 x也变为9,执行语句y=2*z后,形参y值变为6,则相对应的实参x值变为6。执行x =x+y后,形参z值应为12,当然这次调用后,程序代码输出的数值为6,6,12;  第二次调用被调过程proc1,主调过程把实参x,x,z的地址分别传给形参x,y,z。我们应注意一下,此时实参x的值为6而不是1,所以此时形参x,y,z值分别为6,2和2,执行语句x=3*z后,形参x值为6,相对实参x值也相应的变为6。执行语句y=2*z后,形参y值变为4,相应的实参y值也变为4,执行z=x+y后,形参z值变为10,相应的实参y的值变为10,而形参y和x的地址相同,最后它们值都应为10,所以此次调用后,程序代码将输出的数值为6,10和10。

单项选择题

Questions 61-70 are based on the following passage.


While some international couriers are showing signs of exhaustion, EMS (Express Mail Service), the generic name for the courier services of post offices, seems to be finding its stride. Known as Datapost in Britain, as Chronopost in France, and as A1-Barid al-Mumtaz in Saudi Arabia, EMS is now second in the international courier business (jointly with TNT Skypack). Last year it delivered 5.6 million items, weighing less than 20 kilograms each, across borders. That and its annual growth rate of around 5 percent have worried DHL, the market leader, enough for it to counter-attack in the Courts.
On October 26, a Dutch judge ruled against DHL on all three counts filed against the Dutch post office: that the three-initial name was too close to DHL’s; that the orange lines in the EMS logo were too similar to DHL’s dark red ones; and that the claim to the widest route system in the world was unfounded. DHL has threatened the Swiss post office with similar action, but it may reconsider after the Dutch ruling.
EMS has some advantages over the private couriers. One is a dense ready-made network of offices, especially in Europe, the avowed target area of the private couriers. Another advantage is a long tradition of working with customs authorities. In a business where minutes count, it pays to have good friends at customs. That advantage particularly irritates the private couriers because there is no legal way to combat such unquantifiable coziness.
The private courier services are also annoyed because in countries like Switzerland and Italy, where the post office is officially a monopoly, they pay it a fee. In Switzerland DHL says it pays more than SFr lm ($ 708,000) "to the competition" each year. In France the couriers have won a battle for exoneration.
Although governments are under little pressure to keep prices artificially low, EMS is often cheaper than the private couriers, but not always. A recent test in Britain (on a domestic route) showed Datapost about halfway between the least and the most expensive, but gave it full marks for speed and service.
Each national EMS is free to set its rates and follow its own rules on things like bulk discounts. The Universal Postal Union, based in Berne, determines how costs and revenues are split between sending and receiving countries, and standardizes procedures. More than 100 postal administrations have linked into the system—and more are coming, including Russia’s. That makes the feisty EMS particularly happy since its rivals have not been allowed to serve anywhere in Russia.

Which of the following is true of DHL according to the passage

A. It cooperates with TNT Skypack.
B. It is showing signs of exhaustion.
C. It might have a leading position in the international courier business.
D. It has an annual growth rate of 5%.

单项选择题