●在下列程序中:Program test(input,output);var i,j:integer;procedure calc(p1,p2:integer);beg
●在下列程序中:
Program test(input,output);
var i,j:integer;
procedure calc(p1,p2:integer);
begin p2:=p2*p2 p1:=p1-p2;p2:=p2-p1;end{caic}
begin{main}i:=2;j:=3;
calc(i,j); write(j);
end{main}
当参数传递采用引用方式(Call by reference)时,所得结果j= (33) ;
当参数传递采用换名方式(Call by name)时,所得结果j= (34) ;
当参数传递采用赋值方式(Call by value)时,所得结果j= (35) ;
递归是程序设计中很重要的一种控制结构,通常实现递归时,采用的数据结构是 (36) 。
对那些既可以用递归方式,也可以用循环方式求解的问题,就执行效率而言 (37) 。
(33) ,(34) A.10
B.16
C.20
D.28
(35) A.0
B.3
C.5
D.6
(36) A.数组
B.栈
C.队列
D.循环链表
(37) A.数组
B.两者相同
C.循环优于递归
D.递归优于循环