1个回答
展开全部
Private Sub form_load()
Dim x As Single, i As Integer
Do
x = Val(InputBox("请输入一个实数,小于0结束"))
If x <= 0 Then Exit Sub
Print "当x=" & x & "时,经过";
Do
x = x / 2
i = i + 1
Loop While x >= 0.0001
Print i & "次分办,可以得到" & x
Me.Show
Loop
End Sub
Dim x As Single, i As Integer
Do
x = Val(InputBox("请输入一个实数,小于0结束"))
If x <= 0 Then Exit Sub
Print "当x=" & x & "时,经过";
Do
x = x / 2
i = i + 1
Loop While x >= 0.0001
Print i & "次分办,可以得到" & x
Me.Show
Loop
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询