Public Class Form1
    Dim vector(10) As Double

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label2.Visible = False
        Label3.Visible = False
        TextBox11.Visible = False
        vector(0) = Val(TextBox1.Text)
        vector(1) = Val(TextBox2.Text)
        vector(2) = Val(TextBox3.Text)
        vector(3) = Val(TextBox4.Text)
        vector(4) = Val(TextBox5.Text)
        vector(5) = Val(TextBox6.Text)
        vector(6) = Val(TextBox7.Text)
        vector(7) = Val(TextBox8.Text)
        vector(8) = Val(TextBox9.Text)
        vector(9) = Val(TextBox10.Text)
        vector(10) = Val(vector(0))
        For i = 1 To 9
            If vector(i) < vector(10) Then
                vector(10) = vector(i)
            End If
        Next
        Label3.Visible = True
        Label3.Text = "Minimul este:"
        TextBox11.Visible = True
        TextBox11.Text = Str(vector(10))
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Label2.Visible = False
        Label3.Visible = False
        TextBox11.Visible = False
        vector(0) = Val(TextBox1.Text)
        vector(1) = Val(TextBox2.Text)
        vector(2) = Val(TextBox3.Text)
        vector(3) = Val(TextBox4.Text)
        vector(4) = Val(TextBox5.Text)
        vector(5) = Val(TextBox6.Text)
        vector(6) = Val(TextBox7.Text)
        vector(7) = Val(TextBox8.Text)
        vector(8) = Val(TextBox9.Text)
        vector(9) = Val(TextBox10.Text)
        vector(10) = Val(vector(0))
        For i = 1 To 9
            If vector(i) > vector(10) Then
                vector(10) = vector(i)
            End If
        Next
        Label3.Visible = True
        Label3.Text = "Maximul este:"
        TextBox11.Visible = True
        TextBox11.Text = Str(vector(10))
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Label2.Visible = False
        Label3.Visible = False
        TextBox11.Visible = False
        vector(0) = Val(TextBox1.Text)
        vector(1) = Val(TextBox2.Text)
        vector(2) = Val(TextBox3.Text)
        vector(3) = Val(TextBox4.Text)
        vector(4) = Val(TextBox5.Text)
        vector(5) = Val(TextBox6.Text)
        vector(6) = Val(TextBox7.Text)
        vector(7) = Val(TextBox8.Text)
        vector(8) = Val(TextBox9.Text)
        vector(9) = Val(TextBox10.Text)
        For i = 0 To 9
            For j = i To 9
                If vector(i) > vector(j) Then
                    vector(10) = vector(i)
                    vector(i) = vector(j)
                    vector(j) = vector(10)
                End If
            Next
        Next
        TextBox1.Text = Str(vector(0))
        TextBox2.Text = Str(vector(1))
        TextBox3.Text = Str(vector(2))
        TextBox4.Text = Str(vector(3))
        TextBox5.Text = Str(vector(4))
        TextBox6.Text = Str(vector(5))
        TextBox7.Text = Str(vector(6))
        TextBox8.Text = Str(vector(7))
        TextBox9.Text = Str(vector(8))
        TextBox10.Text = Str(vector(9))
        Label2.Visible = True
        Label2.Text = "ordonate crescator"
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Label2.Visible = False
        Label3.Visible = False
        TextBox11.Visible = False
        vector(0) = Val(TextBox1.Text)
        vector(1) = Val(TextBox2.Text)
        vector(2) = Val(TextBox3.Text)
        vector(3) = Val(TextBox4.Text)
        vector(4) = Val(TextBox5.Text)
        vector(5) = Val(TextBox6.Text)
        vector(6) = Val(TextBox7.Text)
        vector(7) = Val(TextBox8.Text)
        vector(8) = Val(TextBox9.Text)
        vector(9) = Val(TextBox10.Text)
        For i = 0 To 9
            For j = i To 9
                If vector(i) < vector(j) Then
                    vector(10) = vector(i)
                    vector(i) = vector(j)
                    vector(j) = vector(10)
                End If
            Next
        Next
        TextBox1.Text = Str(vector(0))
        TextBox2.Text = Str(vector(1))
        TextBox3.Text = Str(vector(2))
        TextBox4.Text = Str(vector(3))
        TextBox5.Text = Str(vector(4))
        TextBox6.Text = Str(vector(5))
        TextBox7.Text = Str(vector(6))
        TextBox8.Text = Str(vector(7))
        TextBox9.Text = Str(vector(8))
        TextBox10.Text = Str(vector(9))
        Label2.Visible = True
        Label2.Text = "ordonate descrescator"
    End Sub
End Class
