用vb编一个很简单的小程序

2024-11-16 04:53:02
推荐回答(4个)
回答1:

Private Sub Command1_Click()
Dim x, k
x = InputBox("请输入一个数据<0~~100%>:")
If x < 0 Or x > 1 Then
k = MsgBox("请输入有效数据!", vbExclamation)
ElseIf x >= 0.1 Then
Print "及格!"
Else
Print "不及格!"
End If
End Sub

回答2:

干啤24
纯生24

回答3:

建议买一本书

回答4:

private function strResult(ByVal X as string) as string
dim intX as integer
intX = X.substring(0,X.length - 1)
if intX>0 and intX<100 then
if intX < 10 then
return "不及格"
else
return "及格"
end if
end if
end function