用vb写出购买地铁车票,若乘1到4站,3元/位;若乘5到9站,4元/位;若
答案:1 悬赏:20 手机版
解决时间 2021-03-12 14:27
- 提问者网友:椧運幽默
- 2021-03-12 11:37
用vb写出购买地铁车票,若乘1到4站,3元/位;若乘5到9站,4元/位;若
最佳答案
- 五星知识达人网友:孤独的牧羊人
- 2021-03-12 12:30
Private Sub Command1_Click()
Dim person As Integer, n As Integer, pay
person = InputBox("请输入乘车人数:")
n = InputBox("请输入乘车站数:")
If n > 0 And n <= 4 Then
pay = person * 3
ElseIf n <= 9 Then
pay = person * 4
Else
pay = person * 5
End If
MsgBox "乘车人数:" & person & vbCrLf + "乘车站数:" & n & vbCrLf & "应付款数:" & pay & "元",,"购票信息"
End Sub
Dim person As Integer, n As Integer, pay
person = InputBox("请输入乘车人数:")
n = InputBox("请输入乘车站数:")
If n > 0 And n <= 4 Then
pay = person * 3
ElseIf n <= 9 Then
pay = person * 4
Else
pay = person * 5
End If
MsgBox "乘车人数:" & person & vbCrLf + "乘车站数:" & n & vbCrLf & "应付款数:" & pay & "元",,"购票信息"
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯