题目内容:
执行下面程序,单击命令按钮Command1,最终A(2,2)的值是(),A(3,1)的值是(),A(4,2)的值是()。Option ExplicitOption Base 1Private Sub Commandl_Ciick()Dim A(4,4)As Integer,i As Integer,j As Integer,k As IntegerFor i=1 To 4For j=1 To 4k=k+1A(i,j)=kNext jNext iCall Transform(A)For i=1 To 4For j=l To 4Text1=Text1 & Right(" " & A(i,j),3)Next jText1=Text1 & vbCrLfNextiEnd SubPrivate Sub Transform(A() As Integer)Dim i As Integer,j As Integer,n As Intege,t As Integer,k As Integern=UBound(A,1)k=n+1For i=1 To n/2For j=1 To nIf i<>j And j<>k-i Thent=A(i,j)A(i,j)=A(k-i,k-j)A(k-i,k-j)=tEnd IfNext jNext iEnd Sub
参考答案: