...我编的程序bei = (a * b * c) / yue / yue 这句显示溢出 高手忙一...
发布网友
发布时间:2024-08-20 18:09
我来回答
共3个回答
热心网友
时间:2024-08-26 09:31
这样子改一下,就不出你说情况了:
Private Sub Command1_Click()
Dim a%, b%, c%, d%, yue%
Dim bei As Long
a = 112
b = 112 + (113 + 114) * Rnd
c = 112 + 113 * Rnd
Text1.Text = Str(a)
Text2.Text = Str(b)
Text3.Text = Str(c)
yue = hcf(c, hcf(a, b))
bei = a * b
bei = bei * c
bei = bei / yue / yue
Text4.Text = Str(yue)
Text5.Text = Str(bei)
End Sub
Function hcf(m%, n%) As Long
Dim r%, t%
r = m Mod n
If m < n Then t = m: m = n: n = t
Do While r <> 0
m = n
n = r
r = m Mod n
Loop
hcf = n
End Function
热心网友
时间:2024-08-26 09:29
数据类型吧
热心网友
时间:2024-08-26 09:29
2 + (113 + 114) * Rnd