求任意两个整数之间所有奇数之和
题目:求任意两个整数之间所有奇数之和 以下c字母存储奇数之和,e,d存储算到多少位,看看哪里不对?谢谢Private Sub Command1_Click()
Dim a, b, c, d, e
a = Val(Text1.Text)
b = Val(Text2.Text)
If a Mod 2 = 0 Then
e = a + 1
Else
d = e
End If
c = 0
e = a
Do Until e > b
c = c + e
e = e + 2
Loop
MsgBox "计算结果为:" & c
End Sub