Private Sub Form_Click()
Cls
n = Val(InputBox("输入行数"))
m = Val(InputBox("输入符号"))
If (n > 100 Or n < 1) Then
Print "输入1~100"
Exit Sub
Print "输入m"
End If
For i = n To 1 Step -1
Print Tab(40 - i)
For j = n - i To 1 Step -1
Print Space(3);
Next
For j = 2 * i - 1 To 1 Step -1
Print CStr(j) & (IIf(j > 100, Space(1), Space(2)));
Next j
Print
Next
End Sub
然后就不知道如何才能自己自定义组成三角形的符号是多少了,求解答T-T
如何修改组成VB倒三角形的符号
Private Sub Form_Click()Cls n = Val(InputBox("输入行数"))m = InputBox("输入符号")If (n > 100 Or n < 1) Then Print "输入1~100"Exit Sub Print "输入m"End If For i = n To 1 Step -1 Print Tab(40 - i)For j = n - i To 1 Step -1 Print Space(3);Next F...
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()Label1 = ""Dim I As Integer Dim sStr As String For I = Val(Text1) To 1 Step -1 sStr = sStr & Format(I)Next For I = 0 To Val(Text1) - 1 Label1 = Label1 & Right(sStr, Len(sStr) - I) & Chr(13)Next End Sub 运行结果 ...
vb程序设计输出倒序三角形
很简单,看代码:Private Sub Form1_l Load Dim a As Integer Dim b As Integer a=Val(Inputbox(“请输入行数”,‘’倒序三角形‘’))For i =1 To a Print Tab(i+8);For j=1 To 11-2*i Print “*”;Next j Print Next i End Sub ...
vb6.0 倒正三角形代码
dim i as integer,r as string for i=1 to 9'正三角形 r=space(9-i)+string(2*i-1,"*")print r next i for i=9 to 1 step -1'倒三角形 r=space(9-i)+string(2*i-1,"*")print r next i
VB 输出杨辉三角金字塔型程序修改
N = Val(InputBox("请输入行数N", "杨辉三角"))ReDim a(N, N)For I = 1 To N a(I, 1) = 1 Next For I = 2 To N For J = 2 To I a(I, J) = a(I - 1, J - 1) + a(I - 1, J)Next Next For I = 1 To N Print Tab(3 * (N - I)); \/\/根据行...
vb有个三角形的启动的符号的那一栏被我弄没了,怎么弄出来,我是英文版...
鼠标移动到系统菜单(最顶)后面的空白处,按鼠标右键,会弹出菜单,选择“标准”就出来了。或者“视图(View)"->"工具栏(Tools)"->"标准(Stand)"...
VB编程 数字以倒三角形排列 的问题 急
你确认你的题目没打错?Label2.Text &= Space(___) 里面的&是明显多余的。Dim i, j, n As Integern = TextBox1.TextLabel2.Text = ""For i = n To 1 Step -1Label2.Text = Label2.Text & Space(n - i)For j = 1 To 2 * i - 1Label2.Text = Label2.Text & n - i...
帮我看看这个判断能否构成三角形的VB程序代码哪里错了?
a = Text1.Text b = Text2.Text c = Text3.Text 这些语句用错,直接读出不为数值,应写为 a = Val(Text1.Text)b = Val(Text2.Text)c = Val(Text3.Text)
vb 循环 三角形 公式
第3行 3个“*”由此可见 这里 “*”的个数变化规律是 等差数列 所以第 n 行 “*”的个数是 -2*(n-1)+7 每行“*”左边的空格的个数也是这样推出来的 把得到的公式应用到双循环中就行了 补充回答: 同样是数学归纳法 你要问的问题就是 左边倒三角的公式是怎么来的 假如...