如下圖
* *
** **
*** ***
**** ****
**********
用vb的 for......next 喔
2006-03-06 07:00:48 · 3 個解答 · 發問者 ? 1 in 電腦與網際網路 ➔ 程式設計
Private Sub Form_Activate()
For i = 1 To 5
Print String(i, "*"); Spc((5 - i) * 2); String(i, "*")
Next i
End Sub
2006-03-06 00:04:45 · answer #1 · answered by 諸葛亮 3 · 0⤊ 0⤋
Private Sub Form_Click()
For a = 1 To 5
For b = 1 To a
Print "*";
Next b
Print Spc(10 - 2 * a);
For c = 1 To a
Print "*";
Next c
Print
Next a
End Sub
2006-03-06 01:57:19 · answer #2 · answered by 小龍 3 · 0⤊ 0⤋
Private Sub Command1_Click()
Dim I, J
Me.FontName = "細明體"
J = 8
For I = 1 To 5
S = String(10, "*")
Mid$(S, I + 1) = String$(J, " ")
J = J - 2
Print S
Next
End Sub
2006-03-05 15:18:13 · answer #3 · answered by W.J.S. 7 · 0⤊ 0⤋