vb题目帮忙看下

来源:百度知道 编辑:UC知道 时间:2024/07/04 22:54:53
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
a=3
b=4
c=5
Print SecProc(c, b, A)
End Sub
Function FirProc(x As Integer, y As Integer, z As Integer)
FirProc=2*x+y+3*z
End Function
Function SecProc(x As Integer, y As Integer, z As Integer)
SecProc=FirProc(z, x, y) +x
End Function
执行结果是28.我想知道结果是2*3+5+3*4+5=28还是2*3+4+3*5+3=28
帮忙了,先谢谢。

令a=3,b=4,c=5,调用SecProc(a,b,c)

就是调用SecProc(5,4,3)

SecProc返回FirProc(3,5,4)+5

FirProc返回2*3+5+3*4

所以调用结果是:2 * 3 + 5 + 3 * 4 + 5 = 28

输出 28

2*3+5+3*4+5=28

secproc x--c--5 y--b--4 z--a--3
firproc(z-3,x-5,y-4)+x--5

firproc(3,5,4)
2*3+5+3*4

所以 2*3+5+3*4+5

3.5.4=xyz+5
2*3+5+3*4+5正确

2*3+5+3*4+5=28

在FirProc=2*x+y+3*z设置断点,然后鼠标放在要查看的变量上就能看到当前值