专业技术初级资格程序员基础知识2003年程序员考试上午试题
题目内容

●在下面的主程序中,实参a与形参x以引用调用(call by reference)的方式传递信息,实参b与形参y以值调用(call by value)的方式传递信息,那么,从过程"compute"返回主程序后a和b的值分别为___(16)___。 <table style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-COLLAPSE: collapse; BORDER-TOP: medium none; BORDER-RIGHT: medium none; mso-border-alt: solid windowtext 1.5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: 1.5pt solid windowtext; mso-border-insidev: 1.5pt solid windowtext" border="1" cellspacing="0" cellpadding="0" _dj="MsoNormalTable"><tbody><tr style="PAGE-BREAK-INSIDE: avoid"><td style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext 1.5pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; WIDTH: 104.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid; PADDING-TOP: 0cm" valign="top" width="139">Main program</td><td style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; WIDTH: 30.3pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid; PADDING-TOP: 0cm; mso-border-left-alt: solid windowtext 1.5pt" valign="top" rowspan="4" width="40"> </td><td style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; WIDTH: 140.7pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid; PADDING-TOP: 0cm; mso-border-left-alt: solid windowtext 1.5pt" valign="top" width="188">Procedure compute(x,y)</td><td style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" width="0"> </td></tr><tr style="PAGE-BREAK-INSIDE: avoid; HEIGHT: 13.65pt"><td style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext 1.5pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; WIDTH: 104.4pt; PADDING-RIGHT: 5.4pt; HEIGHT: 13.65pt; BORDER-TOP: medium none; BORDER-RIGHT: windowtext 1.5pt solid; PADDING-TOP: 0cm; mso-border-top-alt: solid windowtext 1.5pt" valign="top" rowspan="3" width="139">a:=1;b:=2;compute(a,b);</td><td style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; WIDTH: 140.7pt; PADDING-RIGHT: 5.4pt; HEIGHT: 13.65pt; BORDER-TOP: medium none; BORDER-RIGHT: windowtext 1.5pt solid; PADDING-TOP: 0cm; mso-border-top-alt: solid windowtext 1.5pt; mso-border-left-alt: solid windowtext 1.5pt" valign="top" rowspan="3" width="188">x := x + 2*y;y := 2*x + y;return;</td><td style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; HEIGHT: 13.65pt; BORDER-TOP: medium none; BORDER-RIGHT: medium none" height="18" width="0"></td></tr><tr style="PAGE-BREAK-INSIDE: avoid; HEIGHT: 13.65pt"><td style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; HEIGHT: 13.65pt; BORDER-TOP: medium none; BORDER-RIGHT: medium none" height="18" width="0"></td></tr><tr style="PAGE-BREAK-INSIDE: avoid; HEIGHT: 13.65pt; mso-yfti-lastrow: yes"><td style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; HEIGHT: 13.65pt; BORDER-TOP: medium none; BORDER-RIGHT: medium none" height="18" width="0"></td></tr></tbody></table> 

2024-07-09

A.5和2

B.5和12

C.l和2

D.1和12

题目答案

试卷相关题目

最新试卷
热门试卷

长理培训客户端 资讯,试题,视频一手掌握

去 App Store 免费下载 iOS 客户端