vB l中 用 WHILE 來做 121 12321 1234321 金字塔求答!急要

題目:

vB l中 用 WHILE 來做 121 12321 1234321 金字塔求答!急要
用WHILE!

解答:

Private Sub Command1_Click()
Dim i, a As Integer, b As String
Do
a =4
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 Su

添加新評論

暱稱
郵箱
網站