Private Sub Command1_Click()
For i = 1 To 8
For j = 1 To 9 - i
Print " ";
Next j
For j = 1 To 2 * i - 1
Print "*";
Next j
For j = 1 To 10
Print " ";
Next j
For j = 1 To 2 * (9 - i) - 1
Print "*";
Next j
Next i
End Sub
vb中输出两个上下颠倒的星号三角形
Private Sub Command1_Click()For i = 1 To 8 For j = 1 To 9 - i Print " ";Next j For j = 1 To 2 * i - 1 Print "*";Next j For j = 1 To 10 Print " ";Next j For j = 1 To 2 * (9 - i) - 1 Print "*";Next j Print Next i Print End Sub ...
vb怎样打出“*”号倒三角形来?
可以参考下面的代码: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))Pr...
VB里用星号输出平行四边形、正三角、倒三角的程序语句?
二、Sub Command1_Click()Dim i As Integer For i = 1 To 11 Step 2 For m = 11 To i Step -1 Debug.Print "*";Next Print Chr(10) & Space(1 + i \\ 2);Next End Sub
vb 如何平行输出两个三角形
Print Tab(i); String((n - i) * 2 + 1, "*"); Space(1); String(i * 2 - 1, "*")'*只能隔行1,3,5个这样格式输出,space(1)中间的1可以改成任何整数,表示两个三角形间隔的空格数 Next End Sub
vb:如何在文本框中用星号打印等腰三角形???
Dim i As Integer Dim j As Integer For i = 1 To 10 Text1.Text = Text1.Text & Space(12 - i) '关键在于这一句 For j = 1 To i Text1.Text = Text1.Text & "*"Next j Text1.Text = Text1.Text & Chr(13) + Chr(10) 'vbCrLf Next i ...
vb用*号 打印输出图形
strOutput = strOutput + " " 'msgbox里一个星号的宽度是两个空格宽度,所以这里加两个空格,如果用别的方法输出看情况修改 Next j For j = 1 To i * 2 strOutput = strOutput + "*"Next j Else For j = 1 To i - 3 strOutput = strOutput + " " 'msgbox里一个星号...
VB 打印星号组成的三角形 设置前景色背景色
'先建个图片框Picture1 然后把下面的程序替换你原来的Command1_click()即可Private Sub Command1_Click() Picture1.Cls r = 1 Do While r <= 5 c = 10 - r s = 1 Do While s <= 2 * r - 1 Picture1.Print Tab(s + c); "*"; s = s + 1 Loop...
vb用星号打印倒直角三角形求解
Private Sub Command1_Click()For i = 0 To 8 '共打印9行 For j = 1 To i Print " "; '每行上先打印i个空格 Next j For j = 1 To 9 - i Print "*"; '再打印9-i个*号 Next j Print '一行打印结束就换行 Next i End Sub ...
vb输出星号的问题
Private Sub Command2_Click()j = 0: b = 0 x = 4 '调整行拐点 For i = 1 To 16 '输出行数 Print Space(j); "***"If j = x Then b = 1 If j = 0 Then b = 0 If b = 0 Then j = j + 1 Else j = j - 1 Next End Sub ...
怎么用VB星号输出这个形状???、 *** *** *** *** ** *
觉得String(i,"*")不习惯,可以用常规的 For i = 1 To 6 '行数 For j = 1 To 7 - i '列数,随着i变大j变小 Print "*";Next j Print '换行 Next i