VB练习题从键盘输入任意三个数A,B,C,将其值按由大到小的顺序显示出来.

2个回答

  • Private Sub Form_Load()

    Dim x As Integer,y As Integer,z As Integer

    Dim diyige As Integer

    Dim dierge As String,disange As String,disige As String

    diyige = InputBox("请输入A:","数据输入")

    dierge = InputBox("请输入B","数据输入")

    disange = InputBox("请输入C","数据输入")

    x = Val(diyige)

    y = Val(dierge)

    z = Val(disange)

    If x > y And y > z Then

    Print x,y,z

    ElseIf y > z And z > x Then

    Print y,z,x

    ElseIf z > x And x > y Then

    Print z,x,y

    End If

    Print "你输入的数据按从da到xiao的顺序是:"

    End Su