Visual Basic程序问题
问题描述:
Visual Basic程序问题
与程序段:
a = a + b
b = a - b
a = a - b
功能相同的程序段是
A.a = b
b = a
B.a = a + b
a = a - b
b = a - b
C.t = a
a = b
b = t
D.If a > b Then
a = b
Else
b = a
End If
答案是C,为什么呢?
答
就是把值换一下.
如
a=10
b=5
a = a + b'10+5=15
b = a - b'15-5=10b=10
a = a - b'15-10=5a=5
答案C也是这个效果.