展开全部
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer
Randomize
j = Fix(Rnd * 99) + 1
'Print j
Do
k = InputBox("请输入你猜的数:", "提示", 0)
If k > j Then
Print "大了"
ElseIf k < j Then
Print "小了"
Else
Print "猜对了"
End If
i = i + 1
If i > 150 Then Exit Do
Loop Until j = k
End Sub
Dim i As Integer, j As Integer, k As Integer
Randomize
j = Fix(Rnd * 99) + 1
'Print j
Do
k = InputBox("请输入你猜的数:", "提示", 0)
If k > j Then
Print "大了"
ElseIf k < j Then
Print "小了"
Else
Print "猜对了"
End If
i = i + 1
If i > 150 Then Exit Do
Loop Until j = k
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询