2个回答
展开全部
Private Sub Form_Click()
Dim n As Integer
Dim i As Integer
n = Val(InputBox("请输入倒三角形的行数"))
For i = n To 0 Step -1
For j = 0 To n - i
Print " ";
Next j
For j = 1 To i
Print "*";
Next j
Print
Next i
End Sub
Dim n As Integer
Dim i As Integer
n = Val(InputBox("请输入倒三角形的行数"))
For i = n To 0 Step -1
For j = 0 To n - i
Print " ";
Next j
For j = 1 To i
Print "*";
Next j
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Click()
Dim n As Integer
Dim i As Integer
n = Val(InputBox("请输入倒三角形的行数"))
For i = n To 0 Step -1
Print spacex(i)
Next i
End Sub
Function spacex(ByVal n As Integer) As String
Dim i As Integer
Dim Temp As String
For i = 1 To n
Temp = Temp & "*"
Next i
spacex = Temp
End Function
Dim n As Integer
Dim i As Integer
n = Val(InputBox("请输入倒三角形的行数"))
For i = n To 0 Step -1
Print spacex(i)
Next i
End Sub
Function spacex(ByVal n As Integer) As String
Dim i As Integer
Dim Temp As String
For i = 1 To n
Temp = Temp & "*"
Next i
spacex = Temp
End Function
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询