用VB写乘法表 右下三角的

2025-01-07 23:54:24
推荐回答(2个)
回答1:

Private

Sub Mul()
Dim a, b, c As Integer
Text1.Text = ""
For a = 1 To 9
For b = 1 To a
c = b * a
Text1.Text = Text1.Text & b & "*" & a & "=" & c & ";"
Next b
Text1.Text = Text1.Text & Chr(13) & Chr(10)
Next a
End Sub

回答2:

Private Sub Command1_Click()
Dim a, b, c, d As Integer

For b = 1 To 9
For a = 1 To b
c = b * a
If d < b And b <> 1 Then
Print
End If
Print a & "*" & b & "=" & c & " ";
d = b
Next
Next

End Sub