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:如何在文本框中用星号打印等腰三角形???
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用星号打印倒直角三角形求解
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用*号 打印输出图形
用什么控键输出?textbox, label还是messagebox? 下面的程序用msgbox输出,另外三角形怎么才四行数据,是不是应该是这样:Private Sub CommandButton1_Click()Dim intRowNumber As Integer Dim i As Integer Dim j As Integer Dim strOutput As String intRowNumber = 5 '画菱形部分 For i = 1 To...
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循环结构输出下列三角形
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