如何在VB下用FOR 循环语句打印出一个倒三角形 5
2个回答
展开全部
Private Sub Command1_Click()
Dim i As Long, j As Long
Dim strTemp As String, strXing As String
For i = 0 To 3
strXing = ""
For j = 1 To (7 - Abs(i) * 2)
strXing = strXing & "*"
Next
strTemp = Space(Abs(i)) & strXing & Space(Abs(i))
Print strTemp
Next
End Sub
Dim i As Long, j As Long
Dim strTemp As String, strXing As String
For i = 0 To 3
strXing = ""
For j = 1 To (7 - Abs(i) * 2)
strXing = strXing & "*"
Next
strTemp = Space(Abs(i)) & strXing & Space(Abs(i))
Print strTemp
Next
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询