VB编程,打印如下所示的几何图形

* * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * *
2024-12-29 00:06:38
推荐回答(2个)
回答1:

Private Sub printstar()
dim i as integer
For i = 7 To 0 Step -1
For j = 0 To 7
If j >= i Then Debug.Print "*" Else Debug.Print " "

Next
Debug.Print Char(13) ' 输出回车键
Next
End Sub

回答2:

下列代码打印在窗体上:新建一个Form就OK
Private Sub Form_Load()
Me.AutoRedraw = True
Me.Font.Name = "宋体"
Dim i As Integer
For i = 1 To 7
Print String$(7 - i, " ") & String$(i, "*")
Next
End Sub