Sub 作业3()
Dim i As Integer, str As String, s As String, j As Integer, k As Integer
s = " ": str = s
For i = 1 To 5
For j = 1 To (5 - i)
str = str + " "
Next j
For k = 1 To i
str = str + "* "
Next k
str = str + vbNewLine + s
Next i
For i = 4 To 1 Step -1
For j = 1 To (5 - i)
str = str + " "
Next j
For k = 1 To i
str = str + "* "
Next k
str = str + vbNewLine + s
Next i
MsgBox str
End Sub