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中输出两个上下颠倒的星号三角形
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()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用*号 打印输出图形
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使用星号输出一个五行的直角三角形
For i = 1 To 5 Print String(i, "*")Next i
vb 如何用循环输出以下三角形
Private Sub Command1_Click()' 杨辉三角形 Dim i As Integer Dim j As Integer Dim n As Integer n = 5 Cls For i = 1 To n Print String(i - 1, " ");For j = 1 To (n + 1) - i Print CStr(i); " ";Next j Print Next i End Sub Private Sub Command2_...
VB里用星号输出平行四边形、正三角、倒三角的程序语句?
一、Private Sub Form_Click()show Dim m, n, i, j As Integer m = 4 :n = 7 For i = 1 To m For j = 1 To m - i + 1 Print " ";Next j For j = 1 To n Print "*";Next j Print Next i Print For i = 1 To m For j = 1 To m - i + 1 Print " ";N...
vb 循环 三角形 公式
第3行 3个“*”由此可见 这里 “*”的个数变化规律是 等差数列 所以第 n 行 “*”的个数是 -2*(n-1)+7 每行“*”左边的空格的个数也是这样推出来的 把得到的公式应用到双循环中就行了 补充回答: 同样是数学归纳法 你要问的问题就是 左边倒三角的公式是怎么来的 假如...
用VB编写一个无参数Sub过程Triangle,在窗体上输出用“*”组成的如下...
Private Sub Command1_Click()Call Triangle(6)End Sub Private Sub Triangle(N As Integer)Dim i As Integer Me.Cls For i = 1 To N Print Tab(N - i + 1); String(2 * i - 1, "*")Next End Sub
VB循环结构输出下列三角形
Private Sub Command1_Click()For i = 1 To 7 Step 2 Print Tab(10 - i); String(i, "* ")Next For i = 5 To 1 Step -2 Print Tab(10 - i); String(i, "* ")Next End Sub