مسالخير للجميع يعطيكم العافيه
بدي المساعده في تصليح الكود ضرب المصفوفات تحتوي ع اعداد randomو لازم يكون عدد الاعمده للمصفوفه الاولى تساوي الصفوف في المصفوفه الثانيه وبس لما كتبت الكود اذا دخلت حجم المصفوفات غير متساوي يعطيني error
ارجو مساعده ضروري تسلمه مسا الثلاثاء يعني بكرى ......شكرا جزاكم الله الف خير
Public Class Form1
Dim array As Integer(,) = New Integer(3, 2) {}
Dim ar = New Random()
Dim array2 As Integer(,) = New Integer(2, 3) {}
Dim ar2 = New Random()
Dim c As Integer(,) = New Integer(2, 2) {}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim k As Integer
Dim j As Integer
Dim o As Integer
For k = 1 To array.GetUpperBound(0)
For j = 0 To array.GetUpperBound(0)
array(k, j) = ar.next(3)
ListBox1.Items.Add(array(k, j))
Next
Next
For i = 1 To array2.GetUpperBound(0)
For j = 0 To array2.GetUpperBound(0)
array2(i, j) = ar.next(3)
ListBox2.Items.Add(array2(i, j))
Next
Next
For k = 1 To c.GetUpperBound(0)
For j = 0 To array.GetUpperBound(0)
For i = 0 To array2.GetUpperBound(0)
c(k, j) += array(k, i) * array2(i, j)
Next
o = c(k, j)
ListBox3.Items.Add(o)
Next
Next
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
End Class