Il codice coretto � :
codice:
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim v(5), c(5), n, r(5) As Integer
Label1.Text = ""
Label2.Text = ""
Randomize()
For i = 1 To 5
v(i) = 1 + Int(Rnd() * 10)
Label1.Text = Label1.Text & v(i) & "-"
If v(i) Mod 2 = 0 Then
r(i) = v(i)
End If
Next
For n = 5 To 1 Step -1
c(n) = r(n)
If c(n) <> 0 Then
c(n) = r(n)
Label2.Text = Label2.Text & c(n) & "-"
End If
Next
Label1.Text = Microsoft.VisualBasic.Left(Label1.Text, Len(Label1.Text) - 1)
Label2.Text = Microsoft.VisualBasic.Left(Label2.Text, Len(Label2.Text) - 1)
End Sub
End Class