1个回答
展开全部
call by value:
a = 3;
g(a);
m = 5;
m = m*x = 5*a = 15;
x = m-5 = 10;
return x+m = 25;
c = 25;
return a+c = 3+25 = 28 (D)
call by reference:
a = 3;
g(a);
m = 5;
m = m*x = 5*a = 15;
a = x = m-5 = 10;
return x+m = 25;
c = 25;
return a+c = 10+25 = 35 (A)
a = 3;
g(a);
m = 5;
m = m*x = 5*a = 15;
x = m-5 = 10;
return x+m = 25;
c = 25;
return a+c = 3+25 = 28 (D)
call by reference:
a = 3;
g(a);
m = 5;
m = m*x = 5*a = 15;
a = x = m-5 = 10;
return x+m = 25;
c = 25;
return a+c = 10+25 = 35 (A)
更多追问追答
追问
m*x = 5*a 是什么意思啊
追答
因为m=5
x=a (参数)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询