Private Sub Command1_Click()
Dim i, a As Integer, b As String
Do
a = Val(InputBox("输入层数:"))
Loop While a < 2 Or a > 9
For i = 1 To a
b = ""
For j = 1 To (i - 1) * 2 + 1
b = b & IIf(j > i, CStr(i * 2 - j), CStr(j))
Next
Print Space(a + 1 - i) & b
Next
End Sub
Private Sub Command1_Click()
Dim n As Integer
n = Val(InputBox("输入层数:"))
For i = 1 To n
Print Spc(n - i);
For j = -i To i
If i - Abs(j) > 0 Then Print Trim(i - Abs(j));
Next j
Print
Next i
End Sub