Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim x As Integer, max As Integer, min As Integer, sum As Integer
        Dim i As Integer
        Dim str1 As String = ""
        Randomize()                     ' 产生不同的随机数序列
        x = Int(200 * Rnd() + 1)        ' 产生一个[1, 200]之间的随机数x
        str1 = str1 & Str(x) & Space(2)
        max = x : min = x : sum = x
        For i = 1 To 9
            x = Int(200 * Rnd() + 1)    ' 产生一个[1, 200]之间的随机数x
            str1 = str1 & Str(x) & Space(2)
            If x > max Then max = x ' 若新产生的随机数大于最大数，则进行替换
            If x < min Then min = x ' 若新产生的随机数小于最小数，则进行替换
            sum = sum + x
        Next
        Label1.Text = str1
        TextBox1.Text = max
        TextBox2.Text = min
        TextBox3.Text = sum / 10
    End Sub
End Class
