问题
填空题
执行下面程序,单击Command1,数组元素a(3,2)的值是(),a(1,2)的值是(),a(2,3)的值是()
Option Explicit
Option Base 1
Private Sub Commandl_Click()
Dim n As Integer,i As Integer,j As Integer
Dim a(3,3)As Integer,k As Integer
n=3:k=1
i=n:j=(n+1)/2
a(i,j)=k
For k=2 To n*n
i=i+1:j=j+1
If i>n And j<=n Then
i=1
ElseIf i<=n And j>n Then
j=1
ElseIf i>n And j>n Then
i=i-2:j=j-1
ElseIf i<=n And j<=n And a(i,j)<>0 Then
i=i-2:j=j-1
End If
a(i,j)=k
Next k
For i=1 To n
For j=1 To n
Pic1.Print Right(" " &Str(a(i,j)),3);
Next j
Pic1.Print
Next i
End Sub
答案
参考答案:1;9;7