4个回答
展开全部
你先新建一个控制台应用程序,然后全部复制就行了,用 Ctrl + F5 调试
Module Module1
Sub Main()
Dim temp As String = "*"
Dim i, j As Short
For i = 1 To 5 Step +2
For j = 1 To i
Console.Write("{0} ", temp)
Next j
Console.WriteLine("")
Next i
Console.ReadLine()
End Sub
End Module
其实你这样不就好了
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String = "*" & vbCrLf & "* * *" & vbCrLf & "* * * * *"
MessageBox.Show(a)
End Sub
多方便
Module Module1
Sub Main()
Dim temp As String = "*"
Dim i, j As Short
For i = 1 To 5 Step +2
For j = 1 To i
Console.Write("{0} ", temp)
Next j
Console.WriteLine("")
Next i
Console.ReadLine()
End Sub
End Module
其实你这样不就好了
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String = "*" & vbCrLf & "* * *" & vbCrLf & "* * * * *"
MessageBox.Show(a)
End Sub
多方便
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
vb.net
Form窗体上放一按纽,Click事件
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim T = 0
For i As Integer = 0 To 2
For j As Integer = 1 To 2 * i + 1
Me.CreateGraphics.DrawString("*", New Drawing.Font("Arial", 9), Brushes.Black, (j - 1) * 8, T) 'Arial为字体 8为列间距
Next
T = T + 10 '10为行间距
Next
End Sub
Form窗体上放一按纽,Click事件
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim T = 0
For i As Integer = 0 To 2
For j As Integer = 1 To 2 * i + 1
Me.CreateGraphics.DrawString("*", New Drawing.Font("Arial", 9), Brushes.Black, (j - 1) * 8, T) 'Arial为字体 8为列间距
Next
T = T + 10 '10为行间距
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
for i = 0 to 2
for j = 1 to 2*i +1
print "*";
next
print
next
for j = 1 to 2*i +1
print "*";
next
next
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
for i as Integer = 0 to 2
for j as integer = 0 to (2*i+1)
Console.writeline(
for j as integer = 0 to (2*i+1)
Console.writeline(
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询