vb写,谢谢
2个回答
展开全部
Private Sub Command1_Click()
Randomize
Dim I As Long, J As Long
Static K As Long
I = Val(Text1.Text)
J = Int(Rnd * 100) + 1
If I > J Then
Label1.Caption = "你输入的数大了!"
ElseIf I = J Then
Label1.Caption = "太厉害了,你输入的数正好!"
Else
Label1.Caption = "你输入的数小了!"
End If
K = K + 1
Label2.Caption = "你一共猜了:" & K & "次。"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询