' 功能:下面的程序段用于求矩阵相乘 C=A × B ,设 A 、 B 、 C 分别为 ' m × p 、 p × n 、 m × n 的矩阵。 '------------------------------------------------------- Private Sub Form_Click() Const m = 4, p = 3, n = 2 Dim a(1 To m, 1 To p) As Integer Dim b(1 To p, 1 To n) As Integer Dim c(1 To m, 1 To n) As Integer Dim i As Integer, j As Integer, k As Integer, sum As Integer For i = 1 To m For k = 1 To p a(i, k) = i Next k Next i For i = 1 To p For k = 1 To n b(i, k) = i Next k Next i For i = 1 To m For j = 1 To n '**********SPACE********** 【 ? 】 For k = 1 To p '**********SPACE********** sum = sum + 【 ? 】 Next k '**********SPACE********** c(i, j) = 【 ? 】 Next j, i Print " 输出矩阵 " For i = 1 To m For k = 1 To n Print c(i, k), Next k Print Next i End Sub