[填空题] 执行下面程序,单击Command1,数组元素a(3,2)的值是(),a(1,2)的值是(),a(2,3)的值是()Option ExplicitOption Base 1Private S
19 查阅
[填空题] 执行下面程序,单击Command1,数组元素a(3,2)的值是(),a(1,2)的值是(),a(2,3)的值是()Option ExplicitOption Base 1Private Sub Commandl_Click()Dim n As Integer,i As Integer,j As IntegerDim a(3,3)As Integer,k As Integern=3:k=1i=n:j=(n+1)/2a(i,j)=kFor k=2 To n*ni=i+1:j=j+1If i>n And j<=n Theni=1ElseIf i<=n And j>n Thenj=1ElseIf i>n And j>n Theni=i-2:j=j-1ElseIf i<=n And j<=n And a(i,j)<>0 Theni=i-2:j=j-1End Ifa(i,j)=kNext kFor i=1 To nFor j=1 To nPic1.Print Right(" " &Str(a(i,j)),3);Next jPic1.PrintNext iEnd Sub
参考答案: