系统总是说除数为0,到底哪不对请各位指点:
Private Sub Command1_Click()
Dim i As Integer
Dim N As Integer
If i <= N Then
For i = 1 To N
Print i = i + 1
Next
Text2.Text = Str$((5# / Val(N)) * Val(Text1.Text))
End If
End Sub
Const a = 10
Private Sub Command1_Click()
Dim i As Integer
Dim n As Integer
Dim a As String
Text1.Text = a
n = InputBox("请输入")
If i <= n Then
For i = 1 To n
i = i + n
Next
Text2.Text = Str((5# / Val(n)) * Val(Text1.Text))
MsgBox "i等于:" & i
End If
End Sub