[单选题]

在下列程序中:

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.递归优于循环

参考答案与解析:

相关试题

在下列程序中:Program test(input,output);var i

[单选题]在下列程序中:Program test(input,output);var i.j:integer;procedure calc(p1,p2:integer);beginp2:=p2*p2 pl:=pl-p2;p2:=p2-p1;end{caic}begin{main}i:=2;j:=3;calc(i,j);write(j);end{main}当参数传递采用引用方式(Call by reference)时,所得结果j= (6) ;当参数传递采用换名方式(Call by name)时,所得结果,j

  • 查看答案
  • 英语INPUT/OUTPUT指()

    [单选题]英语INPUT/OUTPUT指()A .电动的B .输入/输出C .电磁阀D .转换器

  • 查看答案
  • Programmers test a program by running it

    [单选题]Programmers test a program by running it to ensure that the(74)are correct and that the program produces the desired outcome. If errors do occur, the programmer must make the appropriate change and recheck the program until it produces the correct re

  • 查看答案
  • Functional testing tests whether the output is the expected( )with the valid input.

    [单选题]Functional testing tests whether the output is the expected( )with the vali

  • 查看答案
  • BIOS(Basic-Input-&-Output-System基本输入/输出系

    [名词解释] BIOS(Basic-Input-&-Output-System基本输入/输出系统)

  • 查看答案
  • BIOS(Basic Input/Output System)是指基本输入/输出

    [判断题] BIOS(Basic Input/Output System)是指基本输入/输出系统。A . 正确B . 错误

  • 查看答案
  • 若有如下程序: SET TALK OFF INPUT TO X FOR i=1

    [单选题]若有如下程序: SET TALK OFF INPUT TO X FOR i=1 TO 3 INPUT TO Y IF Y>X X=Y ENDIF ENDFOR ?X RETURN 本程序的功能是( )。A.求3个数中的最大值B.求4个数中的最大值C.求3个数中的最小值D.求4个数中的最小值

  • 查看答案
  • The standard in C language contain many useful functions for input and output,string handling,mathem

    [单选题]The standard in C language contain many useful functions for input and outp

  • 查看答案
  • 运行下列程序:x=Input Box("input value Of x”)Se

    [单选题]运行下列程序: x=Input Box("input value Of x”) Select Case x Case Is>O y=y+1 Case Is=0 y=x+2 Case Else y=x+3 End Select Print x;y 运行时,从键盘输入-5,输出的结果是( )。A.-7B.-9C.-8D.-10

  • 查看答案
  • 下列关于Test类的定义中,正确的是______。A) class Test i

    [单选题]下列关于Test类的定义中,正确的是______。A.) class Test implements Runnabte{public void run(){}public void someMethod(){}B.) class Test implements Rnuuable{public void run();}C.) class Test implements Rnuuable{public void someMethod();}D.) class Test implements Rnuu

  • 查看答案
  • 在下列程序中:Program test(input,output);var i