用VB的FOR循环结构编写数字金字塔,用print打印出来。题目:编写程序,打印如下所示的“数字金字塔” 1 121 12321 1234321 123454321 12345654321 1234567654321 12345678765432112345678987654321
VB中用循环语句 for 。。next 怎么实现数字金字塔》?
'前面加空格,改成这样:Private Sub Command1_Click()Dim I As Long, nStr As String, S As Long S = 4 '显示的最大数字,可修改 Me.Cls: Me.AutoRedraw = True For I = 1 To S nStr = String(S - I, " ") & String((I - 1) * 2 + 1, I & "")Me.Print nStr Nex...
用VB编程如何打印数字金字塔
For i = 1 To 9 For j = 1 To 9 - i Print " "; Next j For j = 1 To i Print j; Next j For j = i - 1 To 1 Step -1 Print j; Next j Print Next i
用VB的循环结构编写数字金字塔
For i = 1 To 9 Print Spc(9 - i);For j = 1 To i Print Chr(48 + j);Next j For j = i - 1 To 1 Step -1 Print Chr(48 + j);Next j Print Next i End Sub
vb问题 打印数字金字塔的一段代码,请哪位给我解释一下,要详细一点...
Private Sub Form_DblClick() ‘窗体双击事件 For i = 1 To 9 ’外层循环,用于控制打印行数 For T = 1 To i ‘内层循环,用于控制每行的打印列数 Print Tab(10 - i); ’定位首个打印字符的位置。这里可以使用spc(10-i),可以获得相同的效果 Next For j = 1 To i ‘打印字符 Print...
vb数字金字塔1 121 12321一直到9
Private Sub Form_Click()Dim a(1 To 5) As Integer For j = 1 To 5 a(j) = j Next j For i = 1 To 5 Print Tab(30 - i * 3);For j = 1 To 2 * i - 1 If j > i Then Print a(2 * i - j);Else Print a(j);End If Next j Next i End Sub 望采纳!!!
vb程序设计打印数字金字塔
Private Sub Form_Load()Me.AutoRedraw = True For i = -4 To 4 Print Tab(3 + Abs(i)); String(9 - 2 * Abs(i), Trim(Str(i + 5)))Next i End Sub
VB中如何计算税后金额并输出数字金字塔??
tax = 8000 * 0.05 bbb = (aaa - 10000) * 0.12 End If If aaa > 50000 Then tax = tax + 40000 * 0.12 bbb = (aaa - 50000) * 0.3 End If If aaa > 100000 Then tax = tax + 50000 * 0.3 bbb = (aaa - 100000) * 0.45 End If MsgBox "税前金额:" & aaa &...
关于VB数字金字塔
Print Trim(j); Next PrintNextFor i = 8 To 1 Step -1 Print Space(i - 1); For j = 1 To 10 - i Print Trim(j); Next For j = 9 - i To 1 Step -1 Print Trim(j); Next PrintNextEnd Sub ...
用vb编写打印倒立的数字金字塔,急求。
Private Sub Form_Click()Dim i As Integer, s As String For i = 9 To 0 Step -1 s = String(i * 2 + 1, CStr(i))Print Spc((18 - i * 2) \/ 2);s Next End Sub
如何用VB实现数字金字塔式的图形输出 就像这样 1
Private Sub Command1_Click() For i = 1 To 5 Print Space(6 - i) & Cstr(2 * i - 1); For j = 2 To 2 * i - 1 Print CStr(2 * i - 1); Next j Print Next iEnd Sub