VB高手进来一下啊!

2024-12-21 09:01:41
推荐回答(1个)
回答1:

Private Sub Command1_Click()
Dim n As Integer
Dim sum As Integer
n = InputBox("输入消费金额")
If n > 1000 Then
sum = n * 0.5
ElseIf n > 500 Then
sum = n * 0.7
ElseIf n > 100 Then
sum = n * 0.88
Else
sum = n * 0.95
End If
MsgBox "原价:" & n & vbCrLf & "折扣后:" & sum
End Sub