vb编程输出九九乘法表

希望您的程序切实可用
最好是这种形式的:
1×1=1
1×2=2 2×2=4
1×3=3 2×3=6 3×3=9

(1)print"*"
意思是打印一个字符"*"。
(2)print:print
VB中,一行一句命令,如果你想多句命令一行,可用冒号隔开。
print省略参数就表示输出一个空行。
简单说,"print:print"就等于:
print
print
打印两行空行。
(3)tab(n)函数。
用来将光标移到参数n指定的位置开始输出信息。tab(i*6),(i=1,2,3...),也就是在第6、12、24...格才输出表达式,这样看起来就像一个列表一样。如果你需要更要宽松一点,你写成tab(i*7)也是可以的:)

楼主提供的程序代码,语句有点混乱,运行也不正确.
请参考我提供的以下的乘法表(思路清晰):
Private Sub Form_Click()
Print Tab(35); "乘法表"
Dim Se As String
For I = 1 To 9
For J = 1 To I
Se = I & "X" & J & "=" & I * J
Print Tab((J - 1) * 9); Se;
Next J
Print
Next I
End Sub
温馨提示:内容为网友见解,仅供参考
第1个回答  推荐于2017-09-16
上面的哪是九九乘法表啊
我这有两种

Private Sub Form_Load()
Me.AutoRedraw = True
Cls
For j = 1 To 9
For k = 1 To 9
If k > j Then Exit For
Print k & "*" & j & "=" & j * k; " ";
Next k
Print
Next j
End Sub

''''''''''''''''
Private Sub Form_Click()
Dim i, j As Integer
For i = 1 To 9
For j = i To 9
Line (i * 200, j * 250)-(i * 200, j * 250)
ForeColor = i * j * 253
Print Space((i - 1) * 6); i & "×" & j & "=" & i * j
Next j
Next i
End Sub本回答被提问者采纳
第2个回答  2015-05-03
Private Sub Command1_Click()
Dim i As Integer, j As Integer, s As String
For i = 1 To 9
    
    For j = 1 To i
    s = " " & i & "x" & j & "=" & i * j & String(5, " ")
    If j > 1 And i * j < 10 Then s = s + String(1, " ")
    Label1.Caption = Label1.Caption + s
    Next
    Label1.Caption = Label1.Caption & vbCrLf + " "
    
Next
End Sub

第3个回答  2015-12-30
Private Sub Form_click()
For a = 1 To 9
For b = 1 To a
Print b; "*"; a; "="; b * a;
Next b
Print
Next a
End Sub
Private Sub Form_Load()
Me.AutoRedraw = True
Cls
For j = 1 To 9
For k = 1 To 9
If k > j Then Exit For
Print k & "*" & j & "=" & j * k; " ";
Next k
Print
Next j
End Sub
Private Sub Form_Click()
Dim i, j As Integer
For i = 1 To 9
For j = i To 9
Line (i * 200, j * 250)-(i * 200, j * 250)
ForeColor = i * j * 253
Print Space((i - 1) * 6); i & "×" & j & "=" & i * j
Next j
Next i
End Sub
第4个回答  2013-09-24
Private Sub Form_click()
Dim i As Integer, j As Integer
For i = 1 To 9
For j = i To 9
Print i; "*"; j; "="; i * j; " ";
Next j
Print
Next i
End Sub
for嵌套循环,如有问题,请追问

vb中怎么输出九九乘法表?
vb中输出九九乘法表,可以参考下面的代码:Private Sub Form_Click()For a = 1 To 9 For b = 1 To a Print b; "*"; a; "="; b * a;Next b Print Next a End Sub

用vb在文本框里输出九九乘法表
vb中输出九九乘法表,可以参考下面的代码:Private Sub Form_Click()For a = 1 To 9 For b = 1 To a Print b; "*"; a; "="; b * a;Next b Print Next a End Sub

请问如何用编程编写九九乘法表(并写出操作步骤)?
1. 利用Access数据库创建交互式窗体,配置所需组件以实现人机交互。2. 第一个文本框输入数字,决定乘法表的行数。3. 第二个文本框展示生成的九九乘法表结果。代码讲解:九九乘法表的核心设计是使用两个嵌套的ForNext循环。大循环(i)控制行数,小循环(j)生成每一行的乘法和结果。代码简洁,易于理解...

怎么用VB打九九乘法表
三角形的九九乘法表 Private Sub Form_Load()Dim i, j, s For i = 1 To 9 For j = 1 To i s = s & j & "×" & i & "=" & IIf(Len(i * j) < 2, i * j & " ", i * j) & " "Next s = s & vbCrLf Next MsgBox s End Sub ...

怎样用vb在窗体上输出九九乘法表?
Private Sub Form_Click()Dim i, j As Integer Dim s As String Print Tab(35); "九九乘法表"For i = 1 To 9 For j = 1 To i s = i & "×" & j & "=" & i * j Print Tab((j - 1) * 9 + 2); s;Next j Print Next i End Sub ...

用VB程序怎么做九九乘法表?
Public Class Form1 Private Sub Button1_Click(sender As Object,e As EventArgs)Handles Button1.Click Dim i,j As Integer Dim se As String Label1.Text=""For i=1 To 9 Step 1 For j=1 To 9 Step 1 se=i&"x"&j&"="&i*j Label1.Text&=se&Space(10-Len(se))Next Label1....

利用VB语言编程:输出九九乘法表
上面的哪是九九乘法表啊 我这有两种 Private Sub Form_Load()Me.AutoRedraw = True Cls For j = 1 To 9 For k = 1 To 9 If k > j Then Exit For Print k & "*" & j & "=" & j * k; " ";Next k Print Next j End Sub '''Private Sub Form_Click()Dim i, j ...

用vb编写九九乘法表
用VB程序怎么做九九乘法表的步骤如下:创建显示结果的窗体:编写按钮宏 Private Sub Command1_Click()Dim a, b As Integer Dim s As String: s = ""For a = 1 To 9 For b = 2 To 9 s = s & a & "*" & b & "=" & b * a If b <> 9 Then s = s & Space(1) Else...

VB中怎么用矩阵输出右下倒三角九九乘法表代码?
VB中用矩阵输出右下倒三角九九乘法表代码是:Private Sub Form_Load()show FontSize=12 print tab(25);“九九表”print print "*";for i =1 to 9 print Tab(i*6);i;next i print for j =1 to 9 print j;"";for k = j to 9 m=j*k print tab(k*6);m;" ";next k print...

VB程序设计,功能是打印“九九表”,如图所示。
Private Sub Command2_Click()Print Tab(35); "九九乘法表(下三角)" For i = 1 To 9 For j = 1 To i '就只有这里有点变化1 to i Print Tab((j - 1) * 9); i & "×" & j & "=" & i * j; Next j Print Next i PrintEnd Sub Private Sub Command...

相似回答