在Visual Basic中,与程序段:a = a + bb = a - ba = a - b功能相同的程序段是A. a = b b = aB. a = a + b a = a - b b = a - bC.t = aa = bb = tD. If a > b Thena = b Elseb = a End If
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/15 20:22:20
在VisualBasic中,与程序段:a=a+bb=a-ba=a-b功能相同的程序段是A. a=b b=aB. a=a+b a=a-b b=a-bC.t=aa=bb=tD. Ifa>bThena
在Visual Basic中,与程序段:a = a + bb = a - ba = a - b功能相同的程序段是A. a = b b = aB. a = a + b a = a - b b = a - bC.t = aa = bb = tD. If a > b Thena = b Elseb = a End If
在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
在Visual Basic中,与程序段:a = a + bb = a - ba = a - b功能相同的程序段是A. a = b b = aB. a = a + b a = a - b b = a - bC.t = aa = bb = tD. If a > b Thena = b Elseb = a End If
答案为c
'设a的初始值为20,b的初始值为1
a = a + b 'a的值为21
b = a - b 'b的值为20.即 b=a的初始值
a = a - b 'a=21-20=1=b的初始值,即a=b的初始值
简化之后就是
t = a'中转
a=b
b=t