用vb 编写一个评委打分的程序1. 编写一个评委打分的程序,实现以下功能:a) 单击“评委给分”按钮时弹出InputBo

1个回答

  • Dim a(10) As Integer

    Private Sub Command1_Click()

    For i = 1 To 10

    a(i) = InputBox("请输入第" & i & "个分数")

    Text1.Text = Text1.Text & Str(a(i))

    Next i

    End Sub

    Private Sub Command2_Click()

    Max = a(1)

    Min = a(1)

    For i = 1 To 10

    s = s + a(i)

    If Max < a(i) Then Max = a(i)

    If Min > a(i) Then Min = a(i)

    Next i

    s = (s - Max - Min) / 8

    Text2.Text = Max

    Text3.Text = Min

    Text4.Text = s

    End Sub

    Private Sub Command3_Click()

    Text1.Text = ""

    Text2.Text = ""

    Text3.Text = ""

    Text4.Text = ""

    End Sub

    Private Sub Command4_Click()

    End

    End Su