在下列程序中: Program test(input, output); var i. j:integer; procedure calc(p1, p2: intege
在下列程序中:
Program test(input, output);
var i. j:integer;
procedure calc(p1, p2: integer);
beginp2: = 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=(6);
当参数传递采用换名方式(Call by name)时,所得结果,j=(7);
当参数传递采用赋值方式(Call by value)时,所得结果,j=(8)。
A.3
B.6
C.10
D.16