用vb程序将矩阵35 67 52 50,33 47 66 39,47 56 66 41,30 69 55 38转置 ,怎

1个回答

  • 不需要任何控件,只在窗口足够大就可以!代码如下:

    Dim A(3,3) As Integer,B(3,3) As Integer

    Dim F() As Variant,M As Integer,N As Integer,I As Integer,J As Integer

    Private Sub Form_Click()

    Print "转置矩阵:"

    For I = 0 To 3

    For J = 0 To 3

    B(I,J) = A(J,I)

    Print B(I,J);

    N = N + 1

    Next

    Print

    Next

    End Sub

    Private Sub Form_Load()

    Form1.AutoRedraw = True

    F = Array(35,67,52,50,33,47,66,39,47,56,66,41,30,69,55,38)

    N = LBound(F)

    Print "原始矩阵:"

    For I = 0 To 3

    For J = 0 To 3

    A(I,J) = F(N)

    Print A(I,J);

    N = N + 1

    Next

    Print

    Next

    Print "点击窗口转换为转置矩阵."

    End Sub

    已经运行过.如有什麼问题可以留言,