九九乘法表vb完整编程1
发布网友
发布时间:2023-09-17 17:59
我来回答
共4个回答
热心网友
时间:2024-11-25 19:59
这个很简单的了
就是两个变量,分别的for循环,
代码很简单的。
部分代码:
请新建一个工程,然后在窗体代码中,加入以下代码,运行后,点击窗口,就会出现运行结果。
Private Sub Form_Click()
AutoRedraw = True '让窗口自动重绘,以免挡住了就看不见了
Cls '清除窗体的内容 Width = 9000 '以免窗口太小
Height = 6000
Dim i As Integer, j As Integer
For i = 1 To 9
For j = 1 To i
Print vbTab & i & "×" & j & "=" & (i * j); '输出,用上分号是不让这一行马上就结束了,不然就会看不到梯度了
Next Print '结束这一行
Next
End Sub
具体afuhao.com/article_articleId-94_articleGroupId-50.shtml
热心网友
时间:2024-11-25 20:00
Sub 九九乘法()
Dim x&, y&, i&
Dim arr(1 To 9, 1 To 9)
For x = 1 To 9
For y = 1 To 9
If x <= y Then
arr(y, x) = y & "×" & x & "=" & x * y
End If
Next y
Next x
End Sub
热心网友
时间:2024-11-25 20:00
Private Sub Form_Click()
Dim h As String
Dim a As Integer
Dim b As Integer
For a = 1 To 9
h = ""
For b = 1 To 9
h = h & a & "*" & b & "=" & a * b & vbTab
Next b
Print h
Next a
End Sub
热心网友
时间:2024-11-25 20:01
Private Sub Form_Activate()
For i = 1 To 9
For j = 1 To 9
Print j & "*" & i & "=" & j * i,
Next j
Print
Next i
End Sub