图 a |
图 b |
实现上述功能的 VB 程序如下,请回答下列问题:
Private Sub Command1_Click()
Const n = 6
Dim a(1 To n * n) As Integer
Dim b(1 To n * n) As String
Dim i As Integer, j As Integer, k As Integer, s As String
Dim zf As Integer '变量zf存储数组a元素的值
Dim xb As Integer '变量xb存储数组a的下标
Dim p As Integer
For i = 1 To Len(Text1.Text)
b(i) = Mid(Text1.Text, i, 1)
Next i
k = 1
For i = 1 To n
k = k + (i - 1)
zf = k
a(xb) = zf
p = i + 1
For j = 2 To n
If j <= n - i + 1 Then
zf = zf + p
a(xb + j - 1) = zf
p = p + 1
Else
zf = zf + p
a(xb + j - 1) = zf
End If
Next j
Next i
For i = 1 To n
s = s +
Next i
Text2.Text = s
End Sub