vb星号输入问题
****************要输出这个图形的循环语句底码1****************...
*******
*****
***
*
要输出这个图形的循环语句底码
1
*******
*****
***
* 展开
*****
***
*
要输出这个图形的循环语句底码
1
*******
*****
***
* 展开
2个回答
展开全部
我这回答的是用VB6.0的,我用QBASIC语言运行通过,自己机器没装VB6.0,没办法调试,一般情况下是没有错的
Public Sub Command1_Click()
Dim i As Integer, j As Integer
For i = 4 To 1 Step -1
For j = 1 To 4 - i
Print " ";
Next j
For j = 2 * i - 1 To 1 Step -1
Print "*";
Next j
Print
Next i
End Sub
Public Sub Command1_Click()
Dim i As Integer, j As Integer
For i = 4 To 1 Step -1
For j = 1 To 4 - i
Print " ";
Next j
For j = 2 * i - 1 To 1 Step -1
Print "*";
Next j
Next i
End Sub
展开全部
不知道你用.net还是vb6
这个是.net的,我在别的上面帮人答过。把a的值换了就可以了。
Dim a As Integer
Dim b As Integer
a = 11
b = (a + 1) / 2
For x As Integer = 1 To b
Me.xResultLabel.Text = Me.xResultLabel.Text & Space(x - 1)
For y As Integer = 1 To a
Me.xResultLabel.Text = Me.xResultLabel.Text & "*"
Next y
a = a - 2
Me.xResultLabel.Text = Me.xResultLabel.Text & ControlChars.NewLine
Next x
这个是.net的,我在别的上面帮人答过。把a的值换了就可以了。
Dim a As Integer
Dim b As Integer
a = 11
b = (a + 1) / 2
For x As Integer = 1 To b
Me.xResultLabel.Text = Me.xResultLabel.Text & Space(x - 1)
For y As Integer = 1 To a
Me.xResultLabel.Text = Me.xResultLabel.Text & "*"
Next y
a = a - 2
Me.xResultLabel.Text = Me.xResultLabel.Text & ControlChars.NewLine
Next x
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询