求一个窗口显示用*********组成的三角形VB代码

2024-11-21 17:43:35
推荐回答(1个)
回答1:

等腰三角
Private Sub Command1_Click()
For i = 0 To 5
Print Tab(Abs(i) + 1);
For j = 0 To 2 * (4 - Abs(i)) + 2
Print "*";
Next
Print
Next
End Sub

直角三角
Private Sub Form_Click()
For i = 0 To 5
For j = 0 To i
Print "*";
Next
Print
Next
End Sub

根据需要增加行数..