...编一程序将a与b的值互换。 急~~~谢谢万分感谢~!!!
发布网友
发布时间:2024-09-30 14:07
我来回答
共2个回答
热心网友
时间:2024-10-08 06:12
二次补充:呵呵,原来如此啊。好,好,加上Inputbox,加上Single。按照最新要求,修改代码如下。
================
Option Explicit
Dim a As Single, b As Single, t As Single
Private Sub Command1_Click()
t = a
a = b
b = t
Print a, b '如果需要输出结果的话,加上这一句
End Sub
Private Sub Form_Load()
a = Val(InputBox("a=?"))
b = Val(InputBox("b=?"))
End Sub
热心网友
时间:2024-10-08 06:18
const a = 3
const b = 5
dim c as integer
c = a
a = b
b = c
利用转换的思想
热心网友
时间:2024-10-08 06:11
二次补充:呵呵,原来如此啊。好,好,加上Inputbox,加上Single。按照最新要求,修改代码如下。
================
Option Explicit
Dim a As Single, b As Single, t As Single
Private Sub Command1_Click()
t = a
a = b
b = t
Print a, b '如果需要输出结果的话,加上这一句
End Sub
Private Sub Form_Load()
a = Val(InputBox("a=?"))
b = Val(InputBox("b=?"))
End Sub
热心网友
时间:2024-10-08 06:10
const a = 3
const b = 5
dim c as integer
c = a
a = b
b = c
利用转换的思想